Search column for keyword to populate another column

RodneyC

Active Member
Joined
Nov 4, 2021
Messages
278
Office Version
  1. 2016
Platform
  1. Windows
Column A has about 7000 rows and I need to easily identify which of two categories items in these 7000 rows belong to and will designate this in Column B with either a “S” or a “L”.

To do so, I need a formula that will look in $A$2:$A$6441 for keywords. These keywords include Blowout, Escape, Public and a few others. If this keyword shows up in column A, I need “S” to show up in column B. If the keywords aren’t there, the cell should be populated with “L”

Thank you in advance
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
Give this a try in column B:
=IF(OR($A$2:$A$6441={"Blowout","Escape","Public"}),"S","L")
 
Upvote 0
Give this a try in column B:
=IF(OR($A$2:$A$6441={"Blowout","Escape","Public"}),"S","L")
We're making progress... I've tried that with a bit of a modification, I'm using this =IF(OR(A4={"Blowout","Escape","Public"}),"S","L") in B4 A4 does not include any of those values and as expected/wanted, L shows up in B4.

As I drag down to B5 the formula becomes =IF(OR(A5={"Blowout","Escape","Public"}),"S","L") A5 does include the value Blowout but B5 still displays an L as opposed to the desired S. I'm sure this is because A5 includes more than just the keyword Blowout. It actually says $4,000 Black Friday Cash Blowout and I modified the code to say =IF(OR(A5={"$4,000 Black Friday Cash Blowout","Escape","Public"}),"S","L") and it displayed the S as desired. Each of the cells with keywords such as "Blowout" actually contain multiple words and I'd prefer not to have to type every word from the cell, only a specific keyword.

Is that possible?

Thanks
 
Upvote 0
Another option
Excel Formula:
=SWITCH($A2,"Blowout","S","Escape","S","Public","S","L")
 
Upvote 0
As the words are part of the cell the formula in post#4 won't work.
Try
Excel Formula:
=IF(MAX(--ISNUMBER(SEARCH({"Blowout","Escape","Public"},A2)))>0,"S","L")
 
Upvote 0
Solution
Thanks Fluff and Candyman. I ended up using Fluff's option and it worked perfectly. THANK YOU both.
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,812
Messages
6,121,693
Members
449,048
Latest member
81jamesacct

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