|
-
Apr 6th, 2006, 08:57 AM
#1
Thread Starter
Member
[RESOLVED] Excel and nested IF's
Hi, just a question on nested if's, I assume there are only so many nested if statements you can use (8?) but I need to check on around 20 cells values before updating the current cell with a specific value, is there another way of doing this;
One of my cells has the following, and due to the limitations of the IF statement I can't then calculate on the remaining cells
=IF(Sheet1!$C$10=A3,"Apples",IF(Sheet2!$C10=A3,"Pears",IF(Sheet3!$C10=A3,"Oranges",IF(Sheet4!$C10=A3 ,"Plums",IF(Sheet1!$C15=A3,"Apples",IF(Sheet2!$C15=A3,"Pears",IF(Sheet3!$C15=A3,"Oranges",IF(Sheet4! $C15=A3,"Plums",""))))))))
On sheets 1 to 4 I have around 20 cells I need to check if they are equal to the value presented to A3 on sheet5, similarly this is then used to check other values on sheet5.
Hope I've made myself clear, and someone can help, regards
-
Apr 6th, 2006, 09:10 AM
#2
Re: Excel and nested IF's
You could use an OR statement for each possible output, but it is limited to 30 possible options.
=IF(OR(Sheet1!$C$10=A3,Sheet1!$C15=A3,etc,etc),"Apples",IF(OR(Sheet2!$C10=A3,Sheet2!$C15=A3,etc,etc) ,"Pears",IF(OR(....
Declan
Don't forget to mark your Thread as resolved.
Take a moment to rate posts that you think are helpful 
-
Apr 11th, 2006, 04:13 AM
#3
Frenzied Member
Re: Excel and nested IF's
Use a Select case since you know which cells you're looking at... You can nest ifs in those as well as Or's.
Edited to add.....
I am thinking in VBA, but it will still work.
VB Code:
Select Case Range Sheet1.Range("$C$10") 'Eh, I think that's right...
Case "Apples"
Case "Plums"
Case "Etc."
End Select
Last edited by Spajeoly; Apr 11th, 2006 at 04:16 AM.
-
Apr 11th, 2006, 05:11 AM
#4
Thread Starter
Member
Re: Excel and nested IF's
Hi, thanks for the replies, the IF(OR works well and I think everything is working fine, thanks again for the replies and help
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|