Matching Info In A Cell To Data In A Table On Another Sheet

Cavmoose

New Member
Joined
Dec 15, 2022
Messages
2
Office Version
  1. 2016
Good day,

I am dealing with an issue of getting data to correspond to a table on a different sheet. I'll list out everything first:

Sheet 1:
Column A contains a barcode
Column B contains the second character of Column A (used mid to get that)
Column C is to contain information involving Column B based on information from a table on another sheet

Sheet 2:
Column A contains a list of numbers and letters (0-9 and then switches to A-Z)
Column B contains text that corresponds to each number or letter

What I am trying to do is when I scan a barcode, I want the text from Sheet 2 Column B to appear in Sheet 1 Column C based on the number or letter in Sheet 1 Column B.

I used the following to get it to work but it only seems to be working for the letters and not the numbers. Ex. If Sheet 1 B2=5, it will not display Sheet 2 Column B Text corresponding to 5. However it does work if B2=J. Formula =IFERROR(VLOOKUP(B2,Sheet2!$A$1:$B$32,2,FALSE),"All Off")

Thanks in advance!
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
when you use MID it turns the number into text
so a1jj
will be a text 1 and not a number
then you are looking up for a text 1

maybe a better way
but try this for your mid function
=IFERROR((MID(A2,2,1))*1,MID(A2,2,1))
then see if it looks up OK

or your lookup table - all the numbers need to be text

Cell Formulas
RangeFormula
G2:G5G2="This is "&F2
B2:B6B2=IFERROR((MID(A2,2,1))*1,MID(A2,2,1))
D2:D6D2=IFERROR(VLOOKUP(B2,$F$2:$G$5,2,FALSE),"All Off")
 
Upvote 0
when you use MID it turns the number into text
so a1jj
will be a text 1 and not a number
then you are looking up for a text 1

maybe a better way
but try this for your mid function
=IFERROR((MID(A2,2,1))*1,MID(A2,2,1))
then see if it looks up OK

or your lookup table - all the numbers need to be text

Cell Formulas
RangeFormula
G2:G5G2="This is "&F2
B2:B6B2=IFERROR((MID(A2,2,1))*1,MID(A2,2,1))
D2:D6D2=IFERROR(VLOOKUP(B2,$F$2:$G$5,2,FALSE),"All Off")
That worked! Thank you so much!
 
Upvote 0
you are welcome
there maybe a better way to do - i seem to remember something, but cant work it out ....
 
Upvote 0

Forum statistics

Threads
1,215,541
Messages
6,125,413
Members
449,223
Latest member
Narrian

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