Matching data from spreadsheets with uneven columns

%3CLINGO-SUB%20id%3D%22lingo-sub-1732741%22%20slang%3D%22en-US%22%3EMatching%20data%20from%20spreadsheets%20with%20uneven%20columns%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1732741%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%3CBR%20%2F%3EI%20have%20a%20report%20that%20contains%20about%2013%20columns%20(spreadsheet%20A)%20and%20I%20obtain%20data%20from%20another%20spreadsheet%20that%20contains%20only%207(spreadsheet%20B).%20The%20columns%20are%20of%20different%20length%2C%20and%20data%20that%20fills%20the%20rows%20are%20often%20duplicated.%20What%20I've%20been%20doing%20is%20using%20VLOOKUP%20and%20using%20a%20value%20from%20spreadsheet%20A%20to%20find%20the%20corresponding%20values%20in%20spreadsheet%20B.%20This%20works%20okay%2C%20but%20its%20very%20slow%2C%20repetitive%2C%20and%20prone%20to%20error.%20What%20I'm%20looking%20to%20accomplish%20is%20to%20use%20something%20a%20little%20more%20automated%20to%20avoid%20having%20to%20either%20re-type%20the%20VLOOKUP%20formula%20or%20use%20the%20Lookup%20%26amp%3B%20Reference%20wizard%20each%20time%20I%20move%20to%20a%20new%20column.%20I've%20tried%20using%20Index%20Match%20formulas%20but%20from%20what%20I%20understand%20columns%20have%20to%20be%20the%20same%20length%20in%20order%20for%20it%20to%20work.%20I%20also%20looked%20into%20Power%20Query%20but%20in%20my%20report%2C%20I%20must%20conserve%20the%20duplicate%20entries.%20Can%20anyone%20please%20offer%20any%20suggestions%3F%3C%2FP%3E%3CP%3EThanks!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1732741%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EBI%20%26amp%3B%20Data%20Analysis%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMacros%20and%20VBA%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EPower%20BI%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1734228%22%20slang%3D%22en-US%22%3ERe%3A%20Matching%20data%20from%20spreadsheets%20with%20uneven%20columns%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1734228%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F754353%22%20target%3D%22_blank%22%3E%40Ozz_Kozz%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI'm%20having%20a%20difficult%20time%20grasping%20the%20specific%20nature%20of%20the%20difficulties.%20You%20mention%20different%20numbers%20of%20columns%20(13%20and%207)%20but%20don't%20say%20how%20many%20rows.%20I%20gather%20there%20must%20be%20many%20rows%2C%20given%20your%20description%20of%20VLOOKUP%20being%20slow.%20You%20don't%20specify%20the%20nature%20of%20the%20errors%20to%20which%20it's%20prone.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAnyway%2C%20if%20VLOOKUP%20works%2C%20so%2C%20I%20think%2C%20should%20INDEX%20--%20MATCH%20combinations%2C%20but%20maybe%20without%20any%20advantage%20other%20than%20some%20flexibility.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ENowadays%20there's%20also%20the%20recently%20added%20%3CSTRONG%3EXLOOKUP%3C%2FSTRONG%3E%2C%20which%20delivers%20the%20best%20of%20all%20prior%20lookup%20functions%20...%20so%20give%20it%20a%20try.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIf%20you%20still%20have%20difficulties%2C%20might%20I%20suggest%20that%20you%20post%20a%20sample%20file%20that%20either%20IS%20your%20actual%2C%20so%20long%20as%20it%20contains%20no%20confidential%20or%20private%20information%2C%20OR%20is%20a%20dummy%20file%20that%20simulates%20or%20resembles%20the%20actual.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1734903%22%20slang%3D%22en-US%22%3ERe%3A%20Matching%20data%20from%20spreadsheets%20with%20uneven%20columns%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1734903%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F425987%22%20target%3D%22_blank%22%3E%40mathetes%3C%2FA%3E%26nbsp%3BHi%20Thank%20you%20for%20your%20response.%20I%20will%20post%20a%20sample%20below.%20In%20the%20sample%2C%20I%20start%20with%20a%20sheet%20that%20contains%207%20columns%20and%2017%20rows%20(Sheet%20A).%20The%20only%20column%20that%20has%20data%20is%20the%20Client%20ID%20column.%20I%20need%20to%20transfer%20the%20data%20from%20Sheet%20B%20to%20Sheet%20A%2C%20and%20also%20preserve%20the%20duplicates%20in%20Sheet%20A.%20Sheet%20B%20has%207%20columns%20and%208%20rows%2C%20no%20duplicates.%20What%20I%20have%20been%20doing%20is%20using%20a%20VLOOKUP%20formula%20(%3DVLOOKUP(A2%2CB.xlsx!%24A%242%3A%24B%248%2C2%2CFALSE)%20in%20each%20column%20in%20Sheet%20A%20to%20find%20the%20corresponding%20data%20in%20Sheet%20B.%20The%20problem%20is%20I%20have%20to%20type%20this%20formula%20in%20every%20column%20in%20Sheet%20A%20to%20get%20the%20data%20from%20Sheet%20B.%20In%20my%20actual%20report%2C%20there%20are%20more%20columns%20and%20rows%2C%20but%20my%20overall%20goal%20is%20to%20eliminate%20the%20repetition%20with%20VLOOKUP%20and%20speed%20up%20the%20process%20of%20transferring%20the%20data%20in%20Sheet%20A.%20Thanks!%3C%2FP%3E%3CP%3E%26nb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TR%3E%3CTR%3E%3CTD%3E17664%3C%2FTD%3E%3CTD%3EMertz%3C%2FTD%3E%3CTD%3EEthel%3C%2FTD%3E%3CTD%3E200%3C%2FTD%3E%3CTD%3ENot%20Required%3C%2FTD%3E%3CTD%3E500%3C%2FTD%3E%3CTD%3ENot%20Approved%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%3E40754%3C%2FTD%3E%3CTD%3ESimmons%3C%2FTD%3E%3CTD%3EBobby%3C%2FTD%3E%3CTD%3E300%3C%2FTD%3E%3CTD%3EPassed%3C%2FTD%3E%3CTD%3E700%3C%2FTD%3E%3CTD%3EApproved%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%3E79481%3C%2FTD%3E%3CTD%3ETucks%3C%2FTD%3E%3CTD%3EChris%3C%2FTD%3E%3CTD%3E10%3C%2FTD%3E%3CTD%3EPassed%3C%2FTD%3E%3CTD%3E50%3C%2FTD%3E%3CTD%3EApproved%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%3E98540%3C%2FTD%3E%3CTD%3EDimond%3C%2FTD%3E%3CTD%3EJaime%3C%2FTD%3E%3CTD%3E1000%3C%2FTD%3E%3CTD%3EPassed%3C%2FTD%3E%3CTD%3E2500%3C%2FTD%3E%3CTD%3EApproved%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%3E99788%3C%2FTD%3E%3CTD%3EPiazza%3C%2FTD%3E%3CTD%3EMike%3C%2FTD%3E%3CTD%3E20%3C%2FTD%3E%3CTD%3ENot%20Required%3C%2FTD%3E%3CTD%3E4000%3C%2FTD%3E%3CTD%3EApproved%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%3E24787%3C%2FTD%3E%3CTD%3EJohn%3C%2FTD%3E%3CTD%3ETommy%3C%2FTD%3E%3CTD%3E800%3C%2FTD%3E%3CTD%3EPassed%3C%2FTD%3E%3CTD%3E400%3C%2FTD%3E%3CTD%3ENot%20Approved%3C%2FTD%3E%3C%2FTR%3E%3C%2FTBODY%3E%3C%2FTABLE%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1734985%22%20slang%3D%22en-US%22%3ERe%3A%20Matching%20data%20from%20spreadsheets%20with%20uneven%20columns%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1734985%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F754353%22%20target%3D%22_blank%22%3E%40Ozz_Kozz%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAdd%20a%20row%20above%20your%20Sheet%20A%20table%20with%20the%20numbers%202%20through%20whatever%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ELet's%20say%20that's%20now%20row%201.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThen%20modify%20your%20formula%20so%20it%20uses%20the%20number%20in%20row%201%20as%20the%20offset.%20Thus%3A%3C%2FP%3E%3CP%3E%3DVLOOKUP(%3CSTRONG%3E%24A3%3C%2FSTRONG%3E%2CB.xlsx!%24A%242%3A%24B%248%2C%3CSTRONG%3EB%241%3C%2FSTRONG%3E%2CFALSE)%3C%2FP%3E%3CP%3EWhen%20you%20copy%20that%20to%20all%20the%20rows%20and%20columns%2C%20the%20highlighted%20cell%20references%20will%20change%20appropriately.%20So%20you%20only%20need%20to%20write%20the%20formula%20once%3B%20after%20that%20it's%20copy%20and%20paste.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Occasional Contributor

Hi,
I have a report that contains about 13 columns (spreadsheet A) and I obtain data from another spreadsheet that contains only 7(spreadsheet B). The columns are of different length, and data that fills the rows are often duplicated. What I've been doing is using VLOOKUP and using a value from spreadsheet A to find the corresponding values in spreadsheet B. This works okay, but its very slow, repetitive, and prone to error. What I'm looking to accomplish is to use something a little more automated to avoid having to either re-type the VLOOKUP formula or use the Lookup & Reference wizard each time I move to a new column. I've tried using Index Match formulas but from what I understand columns have to be the same length in order for it to work. I also looked into Power Query but in my report, I must conserve the duplicate entries. Can anyone please offer any suggestions?

Thanks!

6 Replies
Highlighted

@Ozz_Kozz 

 

I'm having a difficult time grasping the specific nature of the difficulties. You mention different numbers of columns (13 and 7) but don't say how many rows. I gather there must be many rows, given your description of VLOOKUP being slow. You don't specify the nature of the errors to which it's prone.

 

Anyway, if VLOOKUP works, so, I think, should INDEX -- MATCH combinations, but maybe without any advantage other than some flexibility.

 

Nowadays there's also the recently added XLOOKUP, which delivers the best of all prior lookup functions ... so give it a try.

 

If you still have difficulties, might I suggest that you post a sample file that either IS your actual, so long as it contains no confidential or private information, OR is a dummy file that simulates or resembles the actual.

 

Highlighted

@mathetes Hi Thank you for your response. I will post a sample below. In the sample, I start with a sheet that contains 7 columns and 17 rows (Sheet A). The only column that has data is the Client ID column. I need to transfer the data from Sheet B to Sheet A, and also preserve the duplicates in Sheet A. Sheet B has 7 columns and 8 rows, no duplicates. What I have been doing is using a VLOOKUP formula (=VLOOKUP(A2,B.xlsx!$A$2:$B$8,2,FALSE) in each column in Sheet A to find the corresponding data in Sheet B. The problem is I have to type this formula in every column in Sheet A to get the data from Sheet B. In my actual report, there are more columns and rows, but my overall goal is to eliminate the repetition with VLOOKUP and speed up the process of transferring the data in Sheet A. Thanks!

 

SHEET A

Client IDLast NameFirst NameWarehouse PriceQ. ControlSale PriceApproved Status?
40921      
40921      
40921      
40921      
17664      
17664      
17664      
40754      
40754      
79481      
79481      
79481      
79481      
98540      
98540      
98540      

 

SHEET B

Client IDLast NameFirst NameWarehouse PriceControlSale PriceApproved Status?
40921WithersBill50Passed100Approved
17664MertzEthel200Not Required500Not Approved
40754SimmonsBobby300Passed700Approved
79481TucksChris10Passed50Approved
98540DimondJaime1000Passed2500Approved
99788PiazzaMike20Not Required4000Approved
24787JohnTommy800Passed400Not Approved
Highlighted

@Ozz_Kozz 

 

Add a row above your Sheet A table with the numbers 2 through whatever

 

Let's say that's now row 1.

 

Then modify your formula so it uses the number in row 1 as the offset. Thus:

=VLOOKUP($A3,B.xlsx!$A$2:$B$8,B$1,FALSE)

When you copy that to all the rows and columns, the highlighted cell references will change appropriately. So you only need to write the formula once; after that it's copy and paste.

Highlighted

@Ozz_Kozz 

As variant

image.png

=IFNA(INDEX($K$4:$P$10,MATCH($B4,$J$4:$J$10,0),MATCH(C$3,$K$3:$P$3,0)),"no such")

and drag formula on entire range. 

Highlighted

@Sergei BaklanHi thanks for your reply. I guess what I was doing incorrectly is having the data in two separate workbooks. I can move the columns into the one sheet and give your formula a shot. Thanks for your help!

Highlighted
Another variation that I believe will work for you. As mathetes pointed out, you need a $ in your first argument ($A2) so the column letter does not change when you copy the formula across (but the row is not fixed, so it will increment when you copy it down).

You could use the columns function to create a counter (since the column B is not fixed, it will increment as you copy the formula across). This relies on the columns in both workbooks being in the same order. Or, you can use the MATCH function as Segei has, but that will rely on both workbooks having the same header text.

Also, note the second argument references all of the columns of the table ($A$2:$G$8) and not just $A$2:$B$8.

=VLOOKUP($A2,B.xlsx!$A$2:$G$8,COLUMNS(B.xlsx!$A$2:B$2),FALSE)