I am trying to get this logic to work in a cell..If A+B>C then use CIf A+B<D then use DIf the above conditions are not satisfied just put A+BI'm not very good with nested if statements..If((A+B>C,C), if(A+B<D, D, A+B))I used something like that statement above.. but its not working.
4/1/2010 5:45:05 PM
yea you should be able to do an if within an if.. there's a limit on how many times you can do it some version of excelhold on lemme look at what you did
4/1/2010 5:48:50 PM
If( ( A + B ) > C, C , if ( ( A + B ) < D, D, A + B ) )minus the spaces, this should work[Edited on April 1, 2010 at 5:56 PM. Reason : ha, html FTL]
4/1/2010 5:50:43 PM
^ +Watch your parenthesis.Also, be aware that if (A+B) is simultaneously greater than C and less than D, C will be returned. D will only be returned if ((A+B) <= C) AND ((A+B) < D).I don't know what C and D are, so this may not be an issue for you.
4/1/2010 6:00:16 PM
you can nest up to 7 logic statements in excel.Is there a possiblility that A+B can be >C and <D at the same time? If so, you have to place the condition you want to take precedent in the first if statement.
4/1/2010 10:14:54 PM
Thanks for the help guys! I got it working now, I think I did it in a very inefficient way, used like 4 ifs.. but got the job done
4/1/2010 10:49:58 PM
4/2/2010 8:21:12 AM
I always found it easier to use a combination of case statements in another sheet and use a combination of vlookup and indirect functions when the calculation gets that complex.being able to nest if statements does come in handy when you need to use if statements that reference other cells with if statements.
4/3/2010 11:48:32 AM