nested if returning a false instead of a number.

mark gardner

Board Regular
Joined
Sep 6, 2006
Messages
58
I have data in 4 adjacent cells A1,B1,C1 and D1.

ex: A1 is 9, B1 is 4, C1 is 1, and D1 is 1.

In E1 I have this formula:


=IF(AND(C1=1,D1<>1),IF(A1>B1+0.4,1,0))

It is supposed to check to see if C1=1 and D1 is not equal to 1 and if so, check to see if A1 is more than .4 greater than B1. If the statement is true it should return a 1, if false, it should return a 0.

The problem is it keeps giving me a 'false' message instead of a 0 when the statement is not true.

can someone tell me how to fix this? I don't understand why it won't carry through to the else part of the if-then-else statement when it is false.

thanks
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
That's because you haven't entered a FALSE argument in for your outer IF (only the inner nested one).

Perhaps you want:
Code:
=IF(AND(C1=1,D1<>1),IF(A1>B1+0.4,1,0),0)
 
Upvote 0
Better yet, I don't think you need to nest the IF statements. You can include more than two conditions for an AND statement. So just check all three at once, i.e.
Code:
=IF(AND(C1=1,D1<>1,A1>(B1+0.4)),1,0)
 
Upvote 0

Forum statistics

Threads
1,224,557
Messages
6,179,508
Members
452,918
Latest member
Davion615

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top