Thread: IF not working
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Greg Wilson Greg Wilson is offline
external usenet poster
 
Posts: 747
Default IF not working

My formula below, which is the one I suggested, returns 0 when C7 <2000 ?

=If(C7=10000, 1200 + (C7-10000) * 0.2, If(C76000, 600 + (C7-6000) * 0.15,
If(C7 2000, (C7-2000) * 0.1, 0)))

As I mentioned in my first post, the reason the C7<=2000 part doesn't
execute is because this condition is included in the condition C7<=6000. If,
for example, C7 equals 900 then this is <=6000 so the SUM((C7-2000)*20%) will
be executed returning a negative value. The C7<=6000 condition is parent to
the C7<=2000 condition and will be evaluated first. IF AND ONLY IF it is
False will the <=2000 be evaluated.

There are redundancies in your code. That is why I was able to simplify it
quite a bit. Recall that I did assume that the B7 in your formula was
supposed to be C7. If this is a false assumption then my formula is wrong.

Greg

"amandooshna" wrote:

Thanks all for your help. Greg, I tried you final IF sum that you suggested,
however my final figure (if less then 2000) still comes out as a negative
number, and I need it to end as 0.

=IF(C7=10000,SUM(6000*10%)+(4000*15%)+((C7-10000)*20%),IF(C7<=10000,IF(C76000,SUM(6000*10%)+ ((C7-6000)*15%),IF(C7<=6000,SUM((C7-2000)*20%),IF(C7<=2000,0)))))

I know the first two IF's are working, however my last IF isn't. So when I
change my figures, it should total to 0 at the end if less then 2000...it is
driving me nuts because I can't seem to get it to work....

"Greg Wilson" wrote:

See my response to your original post.

Greg

"amandooshna" wrote:

=IF(C7=10000,SUM(6000*10%)+(4000*15%)+((C7-10000)*20%),IF(C7<=10000,IF(B76000,SUM(6000*10%)+ ((C7-6000)*15%),IF(C7<=6000,SUM((C7-2000)*10%),IF(C7<=2000,0)))))

This above sum works, execpt for the last IF function. For some reason my
result always comes out with a negative, when it should be 0. Any
suggestions on why? Or what I should do to change?

Thanks!