Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,231
Default 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.
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Nested conditional statements David Biddulph[_2_] Excel Worksheet Functions 0 June 7th 09 07:54 PM
Nested IF statements Valerie Excel Worksheet Functions 2 February 19th 09 03:36 AM
Help with nested if/or statements Nick Excel Discussion (Misc queries) 8 September 14th 07 03:46 PM
I want to use more than 7 nested if then statements IF I only had a brain for IF statements Excel Worksheet Functions 11 August 9th 05 01:28 AM
Nested IF statements John Simons Excel Worksheet Functions 14 February 16th 05 06:17 AM


All times are GMT +1. The time now is 07:41 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"