Issue with the VLOOKUP - wrong find

nLike

New Member
Joined
Dec 9, 2017
Messages
2
Hi,

In the table below I'm having trouble getting vlookup function to work properly. I need to compare two tables (each having 1st column the same, but the values in the further columns differ). The order of the names (sql tables) sometimes is different, and I'm not able to use the sort function because of some reasons, I need to use the vlookup function to compare the values from the first table versus the values in the second table.

So, my idea was to have a third instance of the table that would compare the difference between the first table and the second and give the result. I wanted this to achieve with VLOOKUP.

However, I came up to an interesting "bug" in the vlookup function here. For some reason VLOOKUP function only works when I search up to 30 rows deep, but if I change it to 31 it automatically gives the wrong value.

So down below is the 35 row excerpt table that will do the trick for me to explain. Say, this is going from A1 to G35. For testing purposes, next to it is the same copy pasted table in the fields, going from J1 to P35.

Now in, f/ex field R:1, I enter function =VLOOKUP(A1,J1:P30,1) I get the value LEP_HIS.ArchiveStatus (which is correct). But if I do =VLOOKUP(A1,J1:P31,1) I get the Value COM_OGC.LDAT_Cliplist (which is obviously wrong).

I have no idea why is this happening. Is this some sort of a string conversion thing that's working behind in excel that's causing the issues? Do you think there is some workaround?

Thanks!

P.S. I know upload Excel file would be easier, but I didn't find the option to upload file, I guess it's forbidden.

LEP_HIS.ArchiveStatus331221218480324040112LEP_HIS.ArchiveStatus201218480324040112
LEP_HIS.PRT_PrintJob113394329048128256LEP_HIS.PRT_PrintJob113394329048128256
LEP_HIS.RFA_LDAT_sbl3769678245928180096LEP_HIS.RFA_LDAT_sbl3769678245928180096
COM_SAP.ZCREA_Modul19065692838322632464COM_SAP.ZCREA_Modul19065692838322632464
LEP_SYS.Modullist19003520029841944272LEP_SYS.Modullist19003520029841944272
TRK_HIS.TrackLog534146804616856TRK_HIS.TrackLog534146804616856
LEP_HIS.***_LDat_PIC1232841762864624688LEP_HIS.***_LDat_PIC1232841762864624688
LEP_HIS.BoardStatus164028086487601400LEP_HIS.BoardStatus164028086487601400
LEP_HIS.OGC_LDAT_Cliplist1023725121064776672LEP_HIS.OGC_LDAT_Cliplist1023725121064776672
LEP_HIS.EventLog9091218420563296LEP_HIS.EventLog9091218420563296
LEP_BAS.Templates_ZCREA_Modul162622128117688072LEP_BAS.Templates_ZCREA_Modul162622128117688072
COM_LEP.COM_Log2959135298464304COM_LEP.COM_Log2959135298464304
LEP_BAS.OGC_LD35861288696208384LEP_BAS.OGC_LD35861288696208384
LEP_HIS.WorkTimes27491240728408104LEP_HIS.WorkTimes27491240728408104
LEP_SYS.GenerationStatus28071240528584128LEP_SYS.GenerationStatus28071240528584128
LEP_BAS.FOA_LD370365641621624LEP_BAS.FOA_LD370365641621624
LEP_BAS.PIC_Config124562445610464LEP_BAS.PIC_Config124562445610464
LEP_HIS.***_Log562592168224200LEP_HIS.***_Log562592168224200
LEP_HIS.SAP_StatusRequest131559236013696LEP_HIS.SAP_StatusRequest131559236013696
COM_OGC.LDAT_Cliplist253852032016184COM_OGC.LDAT_Cliplist253852032016184
LEP_HIS.ErrorLog10934563441696LEP_HIS.ErrorLog10934563441696
TRK_HIS.ETE-OperationLog321392344840TRK_HIS.ETE-OperationLog321392344840
COM_***.LDat_PIC92339224816128COM_***.LDat_PIC92339224816128
TRK_HIS.***-OperationLog476392360824TRK_HIS.***-OperationLog476392360824
LEP_HIS.OGC_Error138638414496144LEP_HIS.OGC_Error138638414496144
LEP_HIS.KSK_position6723369616872LEP_HIS.KSK_position6723369616872
LEP_BAS.ETE_LD10243281528888LEP_BAS.ETE_LD10243281528888
LEP_HIS.USW_Error1452564856152LEP_HIS.USW_Error1452564856152
LEP_HIS.ETE_Log1552408812032LEP_HIS.ETE_Log1552408812032
LEP_HIS.RFA_ADat_prt2592321284856LEP_HIS.RFA_ADat_prt2592321284856
COM_SAP.ZCREA4022241049624MUDA4022241049624
LEP_HIS.RFA_Log3892246410456LEP_HIS.RFA_Log3892246410456
TRK_HIS.FOA-OperationLog435200136856TRK_HIS.FOA-OperationLog435200136856
TRK_HIS.TrackErrorLog0200168824TRK_HIS.TrackErrorLog0200168824
TRK_HIS.RFA-OperationLog598200176816TRK_HIS.RFA-OperationLog598200176816

<tbody>
</tbody><colgroup><col><col span="2"><col><col span="3"><col span="2"><col><col span="2"><col><col span="3"></colgroup>
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
.S. I know upload Excel file would be easier, but I didn't find the option to upload file, I guess it's forbidden.

nLike,

Welcome to the MrExcel forum.


You can post your workbook/worksheets to the following free site (sensitive data changed), mark the workbook for sharing, and, provide us with a link to your workbook:

https://dropbox.com
 
Upvote 0
For reference the default lookup in VLOOKUP is TRUE (1), which will find an approximate match, as your table isn't sorted alphabetically this will throw the results you mentioned.

Use =VLOOKUP(A1,J1:P35,1, 0) or =VLOOKUP(A1,J1:P35,1, FALSE) this will bring the result you want as it'll look for an exact match.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,622
Messages
6,120,585
Members
448,972
Latest member
Shantanu2024

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