Assigning a code using a formula

anillinda

New Member
Joined
Apr 20, 2012
Messages
48
I would like to populate say column b based on a value in column a. For example column a has credit card data descriptions and I would like to search the column for say a description with the following words "shell" or "exxonmobil" or "chevron", if the words are found then the code assigned should be "Auto", otherwise it should search for words like "adobe' or "norton" and assign code "software".
Appreciate your help.
Thanks
I tried the following formula and it fails:

=IF(SEARCH("SHELL*",B8),"Auto",IF(SEARCH("ALL*",B8),"Auto",""))
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
Hi,

It sounds like there could be a Long list of items/categories, I suggest building a list of keywords with associated category like my sample below.

Formula in B1 copied down:


Book1
ABCDE
1abcshellxyzAutosearch list:
2abcadobe123SoftwareShellAuto
31234wholefoodsxyzzzMarketExxonmobilAuto
4somehomedepotstuffHomeChevronAuto
5234AmcTheatersopopoAdobeSoftware
6nnnc jiffylube234AutoNortonSoftware
7WholefoodsMarket
8JiffylubeAuto
9HomedepotHome
Sheet229
Cell Formulas
RangeFormula
B1=IFERROR(LOOKUP(2,1/SEARCH(D$2:D$9,A1),E$2:E$9),"")
 
Upvote 0
Thank you so much! This works like a charm:), but how do I understand the formula. I am confused by lookup(2,/search(d2:d9,a1),e2:e9). How do I get a better understanding of this syntax?
Thanks
 
Upvote 0

Forum statistics

Threads
1,215,767
Messages
6,126,777
Members
449,336
Latest member
p17tootie

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