Nested "if" statement

MN_Excel

Board Regular
Joined
Nov 8, 2010
Messages
153
Would anyone be able to help with a formula I'm trying to create regarding "if" and "or." I would like excel to search cells A1 or B1 for a Yes and if either contains Yes to have the result of A. If neither contain Yes I would like to check cells C1 and D1 for Yes and if either of those contain Yes the output would be B. If neither A1, B1, C1, or D1 contain a yes I would like to search E1, and if that contains a yes to have a result of C. Seems like there should be an easy way to do this, I'm just not sure how.
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
What if none of A1:E1 contain "Yes"?

In the below, I had that return "D"

=IF(ISNA(MATCH("Yes",A1:E1,0)),"D",CHOOSE(MATCH("Yes",A1:E1,0),"A","A","B","B","C"))
 
Upvote 0
Would anyone be able to help with a formula I'm trying to create regarding "if" and "or." I would like excel to search cells A1 or B1 for a Yes and if either contains Yes to have the result of A. If neither contain Yes I would like to check cells C1 and D1 for Yes and if either of those contain Yes the output would be B. If neither A1, B1, C1, or D1 contain a yes I would like to search E1, and if that contains a yes to have a result of C. Seems like there should be an easy way to do this, I'm just not sure how.
Maybe this...

=IF(COUNTIF(A1:B1,"yes"),"A",IF(COUNTIF(C1:D1,"yes"),"B",IF(E1="yes","C","")))
 
Upvote 0

Forum statistics

Threads
1,224,590
Messages
6,179,758
Members
452,940
Latest member
rootytrip

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