MrExcel Publishing
Your One Stop for Excel Tips & Solutions

if statements


Posted by Reekha on February 02, 2001 5:34 PM

This is the formula i typed in to calculate grade for set of averages but it gives "F" for all values. i can't seem to figue out what is wrong woth is formula. CAn someone take a look at this and tell me.

=IF(BD8>=89.5,"A", IF(BD8>=79.5,"B",IF(BD8>=69.5,"C", IF(BD8>=59.5,"D","F"))))


Posted by Celia on February 02, 2001 5:51 PM


It should work. Are you sure that the value is in Column BD and in Row 8 ?

Celia

Posted by Tim Francis-Wright on February 02, 2001 7:36 PM

Of course, if the value in BD8 is a percentage,
say 90%, Excel will evaluate it as a decimal,
in this case 0.90. The formula above would
call that an F. (To fix, just replace all of
the numbers in the formula by 100.)

Hope this helps!

Posted by reekha on February 02, 2001 9:32 PM

:thanks alot you gus it worked
thanks

Posted by Mark W. on February 03, 2001 10:23 AM

Reeka, this many nested IF() statements can be a
bit overwhelming. Instead, use:

=VLOOKUP(BD8,{0,"F";59.5,"D";69.5,"C";79.5,"B";89.5,"A"},2)

Posted by Mark W. on February 03, 2001 10:29 AM

Another possiblity

Reeka, if you find the VLOOKUP() solution to be too
difficult to read or interpet try using:

=LOOKUP(BD8,{0,59.5,69.5,79.5,89.5},{"F","D","C","B","A"})