Multiple Column IF Condition

sbrotz

Board Regular
Joined
Jul 22, 2004
Messages
138
I am working with a large worksheet consisting of more than 30,000 rows. I have a need to populate "column A" of each row based on the value of six non-contiguous columns.
If all six columns ( Columns Q, T, W, Z, AC, AND AF) are valued with N/A or are Blank, then
"column A" for the row should have the word ORPHAN.

I know how to value base on one column << =IF(OR(Q415="N/A",Q415=""),"ORPHAN","") >>, but not multiples.

Thanks for the look!
 

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)
Hello sbrotz, welcome to the board.
If I understand - (that being if these cells all have N/A, or they are all blank you
want to return "ORPHAN") then something like this should work.
Code:
=IF(OR(AND(Q415="N/A",T415="N/A",W415="N/A",Z415="N/A",AC415="N/A",AF415="N/A"),AND(Q415="",T415="",W415="",Z415="",AC415="",AF415="")),"ORPHAN","")

Or do you need to display 'ORPHAN' if all of those cells display either N/A, or blank?
 
Upvote 0
longhand:

=if(and(or(q415="NA",q415=""),or(t415="NA",t415=""),....),"ORPHAN","")

...yuou can fill in the blanks!
 
Upvote 0
If they can be any combination of N/A or blank, then perhaps:

=IF(LEN(SUBSTITUTE(Q415&T415&W415&Z415&AC415&AF415,"N/A","")),"","ORPHAN")
 
Upvote 0
=IF(LEN(SUBSTITUTE(Q415&T415&W415&Z415&AC415&AF415,"N/A","")),"","ORPHAN")


Nice approach.
 
Upvote 0
Half Ace - thanks for the quick reply. It is the second situation that needs' to display ORPHAN

'ORPHAN' if all referenced cells display either N/A, or blank.
 
Upvote 0
You're welcome.
It looks like PaddyD & HOTPEPPER both have you taken care of.

(And yeah, I like HOTPEPPER's approach too.) :cool:
 
Upvote 0
If they can be any combination of N/A or blank, then perhaps:

=IF(LEN(SUBSTITUTE(Q415&T415&W415&Z415&AC415&AF415,"N/A","")),"","ORPHAN")

I like it too. Nice one!
 
Upvote 0

Forum statistics

Threads
1,214,817
Messages
6,121,720
Members
449,050
Latest member
MiguekHeka

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