If cell value equals `n in table return value from list of cell to the right of it

KyleJackMorrison

Board Regular
Joined
Dec 3, 2013
Messages
107
Office Version
  1. 365
  2. 2021
  3. 2019
Platform
  1. Windows
Hello,

I have a document where it holds all the information about the companies assets. I need to re-do the asset barcodes with our new naming convention.
(AO-B001 = "Awesome Company" - "Office" - "Class B" - "001")

I'm trying to automate the asset numbers and require a formula to search the asset table > classification column, reference it to the classification types on a different page and return the cell next to it with the classification letter.

Asset Table:
Asset IDClassificationManufactureModel
<Formula Needed>PCDellOptiPlex
<Formula Needed> PhoneiPhone6s
<Formula Needed> MonitorDellWide Boii
<Formula Needed> PCDellOptiPlex 3040

Classifications List on sheet "Settings":
ClassLetter
PhoneA
PCB
MonitorC
FridgeD

So the outcome for the asset ID's will be:

Asset IDClassificationManufactureModel
AO-B001PCDellOptiPlex
AO-A001PhoneiPhone6s
AO-C001MonitorDellwide boii
AO-B002PCDellOptiPlex 3040

I just require the code to assign the classification letter. Don't worry about the Company name, Location or the numbering.

Hope this makes sense.

Kind regards,
Kyle
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
Hi,

Do you mean this:

Book3.xlsx
ABCD
1Asset IDClassificationManufactureModel
2AO-B001PCDellOptiPlex
3AO-A001PhoneiPhone6s
4AO-C001MonitorDellwide boii
5AO-B002PCDellOptiPlex 3040
6
7
8ClassLetter
9PhoneA
10PCB
11MonitorC
12FridgeD
Sheet7
Cell Formulas
RangeFormula
A2:A5A2=IFERROR("AO-"&LOOKUP(2,1/SEARCH(" "&B2&" "," "&A$9:A$12&" "),B$9:B$12)&TEXT(COUNTIF(B$2:B2,B2),"000"),"")
 
Last edited:
Upvote 0
Alternate formula if your Lookup table contains Exact matches only:

Book3.xlsx
ABCD
1Asset IDClassificationManufactureModel
2AO-B001PCDellOptiPlex
3AO-A001PhoneiPhone6s
4AO-C001MonitorDellwide boii
5AO-B002PCDellOptiPlex 3040
6
7
8ClassLetter
9PhoneA
10PCB
11MonitorC
12FridgeD
Sheet7
Cell Formulas
RangeFormula
A2:A5A2=IFERROR("AO-"&VLOOKUP(B2,A$9:B$12,2,0)&TEXT(COUNTIF(B$2:B2,B2),"000"),"")
 
Upvote 0
Solution
Alternate formula if your Lookup table contains Exact matches only:

Book3.xlsx
ABCD
1Asset IDClassificationManufactureModel
2AO-B001PCDellOptiPlex
3AO-A001PhoneiPhone6s
4AO-C001MonitorDellwide boii
5AO-B002PCDellOptiPlex 3040
6
7
8ClassLetter
9PhoneA
10PCB
11MonitorC
12FridgeD
Sheet7
Cell Formulas
RangeFormula
A2:A5A2=IFERROR("AO-"&VLOOKUP(B2,A$9:B$12,2,0)&TEXT(COUNTIF(B$2:B2,B2),"000"),"")

Perfect thank you very much! Even adds the numbers!
 
Upvote 0
You're welcome, thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,216,075
Messages
6,128,662
Members
449,462
Latest member
Chislobog

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