Wednesday 7 November 2018

More than Two Possible Outcomes

More than two possible outcomes 

The IF function returns either a TRUE or a FALSE result, to be able to choose from more than two possible outcomes then you need to have more than one logical test; one test yields two outcomes, two tests yields three possible outcomes etc.

Combine (or nest) more than one IF function inside another to give the possibility of having more than two possible outcomes from a decision structure.  The conditional tests are evaluated in turn to return the possible outcomes.

IF(Conditional Test, True value, IF(Conditional Test, True value, False value)) etc.

For example, based on the value in cell A1; we wish our formula to return either Small, Medium or Large.

Anything up to 20 is Small, Medium is over 20 but less than 50, Large is 50 or over.
=IF(A1<=20, "Small", IF(A1>=50, "Large", "Medium"))

or

=IF(A1<=20, "Small", IF(AND(A1>20, A1<50), "Medium", "Large"))
The nesting limit in Excel is 64 levels.



For Further Course Details Visit Our Homepage

















Microsoft Accredited IT Training Provider
Microsoft Certified Training Materials

IT Training Courses delivered by Microsoft Accredited Facilitators
Microsoft MOS Test Centre London

No comments:

Post a Comment