![]() |
Nested conditional statements
gcotterl wrote...
I've having difficulty following what parts of a formula are triggered if the result of each IF statement is "true" or "false". .... Excel evaluates formulas left to right, so the first condition satisfied produces the result. For example, if cell X99 evaluates to 2.25, the formula =IF(X99<=0, "black", IF(X99<=1, IF(X99<=0.5, "gray", "white" ), IF(X99<=2, IF(X99<=1.5, "pink", "red" ), IF(X99<=3, IF(X99<=2.5, "purple", "blue" ),... The first 3 IF conditions aren't satisfied, but the 4th is (X99<=3). The 5th condition is also satisfied (X99<=2.5), so the return value is "purple". Had X99 evaluated to 2.8, the 4th condition would still have been satisfied, but the 5th wouldn't have been, so the return value would have been "blue". Even if further out in the formula there were a condition X99=2.25, it wouldn't determine the return value because the pair of conditions X99<=3 and X99<=2.5 were satisfied first. See if your Tools menu contains the command Tools Formula Auditing Evaluate Formula. If it does, it'll step through how Excel evaluates your formulas. |
All times are GMT +1. The time now is 10:31 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com