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:
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?


<tbody>
</tbody>
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
=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,214,606
Messages
6,120,485
Members
448,967
Latest member
visheshkotha

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