Vlookup help, comparing list

Full Spool

New Member
Joined
Dec 31, 2012
Messages
22
Office Version
  1. 365
Platform
  1. Windows
Hello,

I am having issues comparing 2 rows with vlookup. My issue is some of my numbers have a "-5" after a series of numbers. Vlookup thinks the numbers
don't exist in my reference data. I don't know how to fix my formula to ignore the "-5" and look at the numbers before so it can draw
a correct comparison.

My formula below "
=VLOOKUP(D2,Mapping!$A$2:$A$61,1,FALSE)

You can see when the -5 is in the Billing Tab and on the Mapping Tab in excel it works. However once the -5 is missing in the billing tab
it no longer correlates.

1611950186012.png


Thanks in advance for any help or direction provided.
 

Some videos you may like

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.

Saba Sabaratnam

Board Regular
Joined
May 26, 2018
Messages
196
Hi

I have the following layout of workbook.



1611952034890.png


Date in the Mapping Tab is

1611952111761.png


Enter the following array formula by pressing Control + Shift + Enter keys together in Cell B1 in Billing Tab

=VLOOKUP(A1,MID('Mapping Tab'!$A$1:$A$9,1,FIND("-5",'Mapping Tab'!A1,1)-1)*1,1,FALSE)

Kind regards

Saba
 

Full Spool

New Member
Joined
Dec 31, 2012
Messages
22
Office Version
  1. 365
Platform
  1. Windows
Looks like that is doing what I need, I just need to somehow format it to fit my spreadsheet. So I don't get errors.
Thank you !

Billing"

1611955303166.png


Mapping Tab"

1611955340120.png
 

AhoyNC

Well-known Member
Joined
Oct 10, 2011
Messages
4,749
Office Version
  1. 365
Platform
  1. Windows
Maybe something like this.
It also helps to let us know what version of Excel you are using.

Billing
Book1
ABCDE
1Meter #Mapping Tab
216382-216382-2
321391-521391-5
42149521495-5
53568-5No Match
Billing
Cell Formulas
RangeFormula
E2:E5E2=IFERROR(INDEX(' Mapping Tab'!$A$2:$A$5,MATCH(D2&"*",' Mapping Tab'!$A$2:$A$5,0)),"No Match")


Mapping Tab
Book1
A
1M1 Code
216382-2
321391-5
421495-5
521333-5
Mapping Tab
 

Full Spool

New Member
Joined
Dec 31, 2012
Messages
22
Office Version
  1. 365
Platform
  1. Windows

ADVERTISEMENT

I am on the latest 365 version of excel.
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
55,349
Office Version
  1. 365
Platform
  1. Windows
I am on the latest 365 version of excel.

I suggest that you update your Account details (click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)
 

Full Spool

New Member
Joined
Dec 31, 2012
Messages
22
Office Version
  1. 365
Platform
  1. Windows

ADVERTISEMENT

I suggest that you update your Account details (click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)

Updated, thank you!
 

Saba Sabaratnam

Board Regular
Joined
May 26, 2018
Messages
196
Hi Full Spool,

As you have 365 Excel, I used XLOOUP to solve your problem.

Layout of my workbook contains the following tabs. :

1612152334866.png


Mapping tab has the following data
1612152400795.png


Billing tab has the following layout.

1612152441256.png


Enter the following formula in B1 and copy it down.

=XLOOKUP(A1,(MID('Mapping tab'!A1,1,FIND("-",'Mapping tab'!A1,1)-1)*1),(MID('Mapping tab'!A1,1,FIND("-",'Mapping tab'!A1,1)-1)*1))

Kind regards

Saba
 

Full Spool

New Member
Joined
Dec 31, 2012
Messages
22
Office Version
  1. 365
Platform
  1. Windows
This is from the Billing tab

Billing MetersMapping Meters
14743
14743​
14921
#N/A​
14921
#N/A​
16328
#N/A​
16581
#N/A​
16582
#N/A​
17250
#N/A​
19230
#N/A​
19231
#N/A​
19742
#N/A​


Mapping Tab

14743-5
14744-5
14745-5
14920-5
14921-5
15723-5
15725-5
16328-2
16581-5
16582-5
17250-5
19230-5
19231-5
19742-5


I keep getting N/A errors or Value errors

1612210120053.png


Anyone have a suggestion? I'm outside my wheel house with excel formulas. Thank you

=XLOOKUP(A2,(MID('Mapping tab'!A1,1,FIND("-",'Mapping tab'!A1,1)-1)*1),(MID('Mapping tab'!A1,1,FIND("-",'Mapping tab'!A1,1)-1)*1))
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
55,349
Office Version
  1. 365
Platform
  1. Windows
Have you tried the formula from AhoyNC in post#4?
 

Watch MrExcel Video

Forum statistics

Threads
1,127,167
Messages
5,623,123
Members
415,956
Latest member
Footballtend

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
Top