View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
pomegranate-man[_2_] pomegranate-man[_2_] is offline
external usenet poster
 
Posts: 14
Default IF Statement not working

I have an IF Statement to give me a number based on sum of another
cell. It looks like this: =IF($B$5<4000000, "0",
IF($B$54000000,"5",IF($B$55000000,"7",IF($B$560 00000,"9",IF($B$5700
0000,"10")))))

If my number is less than 4000000 it gives me the "0" and if it is
greater than 4000000 it gives me "5" but, if the number is greater
than 5000000 it still gives me "5" rather than the correct number.


For example, suppose B5 contains 6000000. Evaluating the IFs in order,
notice that once we get to $B$54000000 we get the result "5" and never get
to test the remaining IFs.

This variation might work better:
=IF($B$57000000,"10",IF($B$56000000,"9",IF($B$5 5000000,"7",
IF($B$54000000,"5","0"))))
From the post it isn't clear what's intended for 4000000 exactly, so think
about where to use versus =

A different approach would be to use a function in the LOOKUP family, as
described in Excel's built-in Help.

Excel 2003 has a tool useful for diagnosing problems like this. Select the
cell with the troublesome formula and use:
Tools Formula auditing Evaluate formula
When the dialog box appears, click "Evaluate". Each click shows one step of
Excel's calculation.