Excel Formula If Statement - multiple criteria

jwoo89

New Member
Joined
Jan 5, 2021
Messages
32
Office Version
  1. 2016
Platform
  1. Windows
Hi All,

I have been trying to figure out the correct formula to use but I am getting stuck. Hopefully someone can help!

I have four columns A-D. In column A I need to pull in the correct sector from column B but Some cells i am not able to pull data in so the following words below show up. Basically if the below three texts show up in that cell, i need to move over to column C but that also appears to have the same issue and from there will need to move to column D and pull the sector from there.
#N/A Invalid Security
#N/A Field Not Applicable
#N/A N/A

So far I have the formula

=IF(M5="#N/A N/A",N5,IF(M5="#N/A Field Not Applicable",N5,IF(M5="N/A Invalid Security",N5,IF(N5="#N/A N/A",O5,IF(N5="#N/A Field Not Applicable",O5,IF(N5="N/A Invalid Security",O5,M5))))))

But when i get to the ones that are invalid and have either of those three words appear the If statement doesn't work.

Can somebody help?

1626894117010.png



Thanks for your help!!!
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
Try
Excel Formula:
=IF(M5="#N/A N/A",N5,IF(M5="#N/A Field Not Applicable",N5,IF(M5="N/A Invalid Security",N5,IF(N5="#N/A N/A",O5,IF(N5="#N/A Field Not Applicable",O5,IF(N5="N/A Invalid Security",O5,"#N/A N/A"))))))
 
Upvote 0
Thanks for your quick response! but sadly it didn't work.

What i want to return in column A is below highlighted in yellow. Basically Column A needs to pull in the sector. But if Columns B and C have either #N/A invalid Security, #N/A Field not Applicable or #N/A N/A i want it to look to the next cell where it will have an actual sector.

1626895151929.png


=IF(M4="#N/A N/A",N4,IF(M4="#N/A Field Not Applicable",N4,IF(M4="N/A Invalid Security",N4,IF(N4="#N/A N/A",O4,IF(N4="#N/A Field Not Applicable",O4,IF(N4="N/A Invalid Security",O4,M4))))))
 
Upvote 0
Try

Excel Formula:
=IF(NOT(OR(M2="#N/A N/A",M2="#N/A Field Not Applicable",M2="N/A Invalid Security")),M2,IF(NOT(OR(N2="#N/A N/A",N2="#N/A Field Not Applicable",N2="N/A Invalid Security")),N2,IF(NOT(OR(O2="#N/A N/A",O2="#N/A Field Not Applicable",O2="N/A Invalid Security")),O2,"Not in M, N or O")))
 
Upvote 0
Can you have 2 columns that return a valid sector? if so which should be used?
 
Upvote 0
If there is only one valid sector, then you could use
Excel Formula:
=LOOKUP(2,1/((LEFT(B2:D2,4)<>"#N/A")*(B2:D2<>"")),B2:D2)
 
Upvote 0
Try

Excel Formula:
=IF(NOT(OR(M2="#N/A N/A",M2="#N/A Field Not Applicable",M2="N/A Invalid Security")),M2,IF(NOT(OR(N2="#N/A N/A",N2="#N/A Field Not Applicable",N2="N/A Invalid Security")),N2,IF(NOT(OR(O2="#N/A N/A",O2="#N/A Field Not Applicable",O2="N/A Invalid Security")),O2,"Not in M, N or O")))
ah still didn't work thank you for trying!
 
Upvote 0
Can you have 2 columns that return a valid sector? if so which should be used?
Yup that is possible! If there is something in the second column we will use that but if there appears to be any of those three errors i want to go to the next cell but that can either have a sector pulled in or it could also have any of those three errors in which case would go to the last cell in column d.
 
Upvote 0
if sector in column B2 then return B2
If B2 has error then go to C2
if sector in column C2 then return C2
If C2 has error then go to D2
if sector in column D2 then return D2
If D2 has error then no result

Correct?
 
Upvote 0
if sector in column B2 then return B2
If B2 has error then go to C2
if sector in column C2 then return C2
If C2 has error then go to D2
if sector in column D2 then return D2
If D2 has error then no result

Correct?
Yup that is correct! Any of those three errors can appear in that field
 
Upvote 0

Forum statistics

Threads
1,215,492
Messages
6,125,115
Members
449,206
Latest member
burgsrus

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