Should this be an IF AND statement or not?

Ajay72

New Member
Joined
Aug 3, 2011
Messages
3
So I'm working on a spreadsheet and have written an IF AND statement which works 50% of the time. I'm not sure if I should be using If AND or if something else is more appropriate.

I have two cells that each have two options from a drop down list. What I want is "if A1 = x and A2 = y then enter value at A3, if A1 = x and A2 = z then enter value at B3, if A1 = c and A2 = y then enter value at C3 if none of these criteria are met then enter value at D3"

What I have written:

=IF(AND($C$3="16:9",$E$4="wide"),D22,IF(AND($C$4="16:9",$E$4="diagonal"),D19,IF(AND($C$3="2.35:1",$E$4="wide"),D23,D20)))

This works for criteria 1 (16:9, Wide) and criteria 3 (2.35:1, wide) but return the false D20 for criteria 2 and for a false statement.

Any help very much appreciated
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
So I'm working on a spreadsheet and have written an IF AND statement which works 50% of the time. I'm not sure if I should be using If AND or if something else is more appropriate.

I have two cells that each have two options from a drop down list. What I want is "if A1 = x and A2 = y then enter value at A3, if A1 = x and A2 = z then enter value at B3, if A1 = c and A2 = y then enter value at C3 if none of these criteria are met then enter value at D3"

What I have written:

=IF(AND($C$3="16:9",$E$4="wide"),D22,IF(AND($C$4="16:9",$E$4="diagonal"),D19,IF(AND($C$3="2.35:1",$E$4="wide"),D23,D20)))

This works for criteria 1 (16:9, Wide) and criteria 3 (2.35:1, wide) but return the false D20 for criteria 2 and for a false statement.

Any help very much appreciated

It appears that you should be referencing $C$3 instead of $C$4 for the second if statement....

:)
 
Upvote 0
Correct! But that has not changed the outcome. Criteria 2 still returns the false statement.
 
Upvote 0
Correct! But that has not changed the outcome. Criteria 2 still returns the false statement.


I would use the Evaluate Formula option in excel... this should help you to see where your formula is going wrong...

just as a guess though, if the "16:9" part is working (as if it didn't the other options would return FALSE), then double check your spelling of "diagonal", both in the formula and in cell E4

:)
 
Upvote 0
Wow, not seen the evaluator before, that's a helpful tool! All sorted now thanks, embarrassed to say it was a schoolboy error!
 
Upvote 0

Forum statistics

Threads
1,224,609
Messages
6,179,876
Members
452,949
Latest member
Dupuhini

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