Nested IF + OR

amp7394

New Member
Joined
Nov 16, 2018
Messages
8
I am trying to get the formula that says "IF this cell contains this OR that" however there are 3 conditions.

Here is an example of a cell:
[TABLE="width: 389"]
<tbody>[TR]
[TD="width: 389"]PLT-NA-NA|CIG-NA-NA|GLD-NCORP-A|BSC-NCORP-A

I have the first part of the formula: =IF(SUM(COUNTIF(A26,"*"&{"PLT-NCORP","PLT-CORP"}&"*")),"PLT","GLD")

However, there is a third condition. If PLT-NA-NA, and GLD-NA-NA, then the value should be NA.

How would I add this third part to the formula?

[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
=if(sum(countif(A26,"*"&{"plt-na-na","gld-na-na"}&"*")),"na",if(sum(countif(A26,"*"&{"plt-ncorp","plt-corp"}&"*")),"plt","gld"))

or even

=LOOKUP(ISNUMBER(SEARCH("PLT-NCORP",A26))*1+ISNUMBER(SEARCH("PLT-CORP",A26))*1+ISNUMBER(SEARCH("PLT-NA-NA",a26))*2+ISNUMBER(SEARCH("GLD-NA-NA",a26))*2,{0,1,2,3},{"GLD","PLT","NA"})
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,173
Members
453,021
Latest member
Justyna P

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