# Multiple columns not mutually exclusive, possible messy nested if?

#### mpndei

##### New Member
Hi all-- qualitative researcher trying to do quantitative work and could use some help here!

I have a spreadsheet where I have 6 columns (N-S) that have binary yes "Y"/no "N" for individual race categories. They may also be blank if the person did not input their race information, which would count as unknown, but needs to remain blank. I need to create a formula in the 7th column (V) that looks across N-S, see what race the person is, then input the letter code for that race. My gut reaction was to do a nested IF, but I also have instances where a person may have multiple yeses (multiracial) so they have another code (S in column V). I have racked my brain and I'm at a loss. I understand that IF will look for only true/false scenarios, and I don't think an if-else is what I'm looking for, but I'm unsure of a way to do one without having to write out every possible combination (they could in theory have yes across all six). The spreadsheet is 30,000 cases, so I can't do this manually.

Picture is a past version of what needs to be accomplished, but there's no code included to figure it out.

So for example, row ending in 76, the case only has Y for White, so V76 is W. Row 81 has all nos, so V81 is U for unknown. Row 82 is both American Indian and White, so they get S in V82 (for multiracial).

### Excel Facts

If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.

#### etaf

##### Well-known Member
so you have 4 codes
B, W, S, U

so some thing like
IF (COUNTIF(N2;S2,"Y") > 1 , "S",
IF (COUNTIF(N2;S2,"Y") = 0 , "U",
that then leaves W or B
How is that worked OUT , maybe a count can work there

In summary
What are the combinations of the Y and the output
we know S is more than 1 Y
we know U is 0 Y

W = ?
B = ?

Replies
8
Views
715
Replies
14
Views
408
Replies
1
Views
307
Replies
2
Views
34
Replies
1
Views
328

1,127,328
Messages
5,624,036
Members
416,007
Latest member
csf

### 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.

### Which adblocker are you using?

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

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