Assign customer names based on multiple criteria

furqan_yousuf

New Member
Joined
Apr 18, 2021
Messages
5
Office Version
  1. 365
Platform
  1. Windows
I downloaded statement from bank and based on certain value in the description field I want to assign value to it. For eg. I download transactions from bank and it has 3 columns (date, description, amount) I will add 4 the column next to amount called "Customer Name". If the description contains "New York" "Manhattan" "Times Sq" the Customer Name will be NYC -- if desc contains "IL" Chicago" "O'hare" the customer name will be "Chicago City" . Excuse my english
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
I may use a lookup table and set it up as below
Book4
ABCDEFGH
1DateDescriptionAmountCustomer nameLookup DescCity Name
206-Apr-21Purchase in O'hare Airport138Chicago CityNew yorkNYC
314-Apr-21sales in New york197NYCTimes SqNYC
414-Apr-21Manhattan restaurant219NYCManhattanNYC
513-Apr-21Times sq School fees payment126NYCILChicago City
617-Apr-21amzn IL159Chicago CityChicagoChicago City
703-Apr-21donation - O'hare167Chicago CityO'hareChicago City
812-Apr-21Fundraiser - Times Sq160NYC
931-Mar-21maintenance charge New york198NYC
10
Sheet3
Cell Formulas
RangeFormula
D2:D9D2=IFERROR(INDEX($G$2:$G$7,MATCH(9.99E+307,SEARCH($F$2:$F$7,B2),1)),"")
 
Upvote 0
Solution
Thank you for the response. It was really helpful.

I have couple of more question, 1) how to do this in power query? 2) all three condition should match, not just 1? For eg if desc contains all three "IL" "O'Hare" "Chicago City" only then the customer will be "Chicago".

Thanks in advance.
 
Upvote 0

Forum statistics

Threads
1,214,429
Messages
6,119,428
Members
448,896
Latest member
MadMarty

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