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

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)

HalfAce

MrExcel MVP
Joined
Apr 6, 2003
Messages
9,454
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?
 

PaddyD

MrExcel MVP
Joined
May 1, 2002
Messages
14,234
longhand:

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

...yuou can fill in the blanks!
 

Scott Huish

MrExcel MVP
Joined
Mar 17, 2004
Messages
19,958
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
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")
 

PaddyD

MrExcel MVP
Joined
May 1, 2002
Messages
14,234

ADVERTISEMENT

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


Nice approach.
 

sbrotz

Board Regular
Joined
Jul 22, 2004
Messages
138
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.
 

HalfAce

MrExcel MVP
Joined
Apr 6, 2003
Messages
9,454

ADVERTISEMENT

You're welcome.
It looks like PaddyD & HOTPEPPER both have you taken care of.

(And yeah, I like HOTPEPPER's approach too.) :cool:
 

Domenic

MrExcel MVP
Joined
Mar 10, 2004
Messages
19,696
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!
 

Forum statistics

Threads
1,136,346
Messages
5,675,229
Members
419,555
Latest member
Paddington

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
Top