#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 117
Default Nested-IF formulas

In a simple "IF" formula:

if the logical_test is TRUE, the 'value-if-true' is returned
if the logical_test is FALSE, the 'value-if-false' is returned.

(I can easily follow that).


====================

But when writing nested-IF formulas (with multiple logical_tests), I
frequently get "lost" determining which of the multiple 'value-if-
true" statements and which of the multiple 'value-if-false" statements
go with each of the multiple logical_tests.

Can someone please un-confuse me? (A visual diagram would be great!)

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,574
Default Nested-IF formulas

Nested IFs follow this syntax: IF THEN ELSE IF THEN ELSE

IF true THEN action ELSE IF true THEN action ELSE ....

E.g.: =IF(A1=A2,A3,IF(A2=A4,A5,A6))

Dave


--
A hint to posters: Specific, detailed questions are more likely to be
answered than questions that provide no detail about your problem.


"GARY" wrote:

In a simple "IF" formula:

if the logical_test is TRUE, the 'value-if-true' is returned
if the logical_test is FALSE, the 'value-if-false' is returned.

(I can easily follow that).


====================

But when writing nested-IF formulas (with multiple logical_tests), I
frequently get "lost" determining which of the multiple 'value-if-
true" statements and which of the multiple 'value-if-false" statements
go with each of the multiple logical_tests.

Can someone please un-confuse me? (A visual diagram would be great!)


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,856
Default Nested-IF formulas

I can't post a diagram here, but in flowchart symbols you can think of
an IF .. THEN .. ELSE .. ENDIF as starting with a diamond shape in
which a question is asked (or the condition is stated) and then coming
out of the left hand corner is "YES" or "TRUE" and out of the right
hand corner is "NO" or "FALSE". These arms then move down into a box -
Action_if_true or Action_if_false and then beyond these boxes the two
outputs join up to form the ENDIF point.

This control structure looks rather like a box with a diamond on the
top line (flow being into the top of the diamond), an action box is on
each of the vertical lines, and the bottom line has another line from
it in the centre taking the flow downwards.

This structure can replace either or both of the action boxes in the
vertical lines, so that you can have a nested IF on the TRUE side as
well as the FALSE side. The IF structure could then be used to further
substitute one or more of the Action boxes.

It's easier to follow with a diagram, but I hope this description
helps.

Pete

On Mar 23, 7:15 pm, "GARY" wrote:
In a simple "IF" formula:

if the logical_test is TRUE, the 'value-if-true' is returned
if the logical_test is FALSE, the 'value-if-false' is returned.

(I can easily follow that).

====================

But when writing nested-IF formulas (with multiple logical_tests), I
frequently get "lost" determining which of the multiple 'value-if-
true" statements and which of the multiple 'value-if-false" statements
go with each of the multiple logical_tests.

Can someone please un-confuse me? (A visual diagram would be great!)



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default Nested-IF formulas

Every diagram is going to be different, of course, depending on the
logic of the statements. If I get a really hairy one that I have
trouble getting the syntax right, then I create each "piece" of the
statement in separate cells. Then I go through and build up the final
statement from the inside out, using the formulas from each of the
cells. I hope that doesn't sound too confusing.

I think someone makes an Excel add-in for creating complex nested
IF's. You could always search around for it.

Also, there is a limit to the nesting. You can only go 7 nests deep.
Chip Pearson has an article showing how to work around this:
http://www.cpearson.com/excel/nested.htm

HTH,

Nicholas Hebb
BreezeTree Software
http://www.breezetree.com

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 353
Default Nested-IF formulas

Just FYI - in 2007:
Nested levels of functions limit is 64
Length of formula contents limit is 8,192 characters
Others:
http://office.microsoft.com/en-us/ex...738491033.aspx

"nhebb" wrote:

Every diagram is going to be different, of course, depending on the
logic of the statements. If I get a really hairy one that I have
trouble getting the syntax right, then I create each "piece" of the
statement in separate cells. Then I go through and build up the final
statement from the inside out, using the formulas from each of the
cells. I hope that doesn't sound too confusing.

I think someone makes an Excel add-in for creating complex nested
IF's. You could always search around for it.

Also, there is a limit to the nesting. You can only go 7 nests deep.
Chip Pearson has an article showing how to work around this:
http://www.cpearson.com/excel/nested.htm

HTH,

Nicholas Hebb
BreezeTree Software
http://www.breezetree.com


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
how to do nested IF formulas BigTim Excel Discussion (Misc queries) 5 September 12th 06 07:39 PM
help in nested if formulas John48 Excel Worksheet Functions 1 July 21st 06 08:01 AM
if nested formulas marleneardon Excel Discussion (Misc queries) 1 May 11th 06 12:23 PM
nested formulas Ctrl-Alt-Del Excel Discussion (Misc queries) 3 January 24th 06 04:17 PM
nested formulas dutchtreet Excel Worksheet Functions 5 February 3rd 05 08:25 PM


All times are GMT +1. The time now is 04:02 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"