+ Reply to Thread
Results 1 to 29 of 29

Using VLOOKUP across two sheets with multiple matches

  1. #1
    Registered User
    Join Date
    08-24-2021
    Location
    Australia
    MS-Off Ver
    Office Pro Plus 2016
    Posts
    15

    Using VLOOKUP across two sheets with multiple matches

    I have two separate spreadsheets.
    Sheet 1 has a product ID, Description and Barcode. The Cost column is empty and it is this that I am trying to fill from sheet 2.
    Sheet 2 Product ID, Description and Cost.
    As you can see, there are multiple lines with the same Product ID and description, but different barcode - these represent different sizes/colours etc. but they all cost the same.
    So how do I fill column "D" - the Cost in sheet 1 from column "C" - the Cost in sheet 2?
    I have assumed it is a VLOOKUP, but maybe something else altogether... Warning - I am an excel novice....
    Attached Files Attached Files

  2. #2
    Forum Expert wk9128's Avatar
    Join Date
    08-15-2020
    Location
    Australia
    MS-Off Ver
    365 V2403 and WPS V2022
    Posts
    3,469

    Re: Using VLOOKUP across two sheets with multiple matches

    (1) workbook : sheet 1
    (2) worksheet name : sheet1
    (3) Cell D2 formula, Drag down
    HTML Code: 
    Attached Images Attached Images
    Attached Files Attached Files
    Last edited by wk9128; 08-24-2021 at 09:21 PM.

  3. #3
    Registered User
    Join Date
    08-24-2021
    Location
    Australia
    MS-Off Ver
    Office Pro Plus 2016
    Posts
    15

    Re: Using VLOOKUP across two sheets with multiple matches

    Hmm...
    1st of all - thanks! I would never have come up with that!
    I pasted the formula into cell D2 of sheet 1, but was returned with "Cost", whereas I actually want it to return 2.5
    I probably shouldn't have included the "Description" column... it was just to try to make things clearer....
    So what I need is... in sheet 1 - whenever Product ID = 1, the corresponding Cost = 2.5 (from Sheet 2)
    When Product ID = 2, Cost = 4.5
    when Product ID = 3, Cost = 10.5
    etc

    Apologies for the confusion

  4. #4
    Forum Expert
    Join Date
    09-30-2019
    Location
    Chiangmai, Thailand
    MS-Off Ver
    Office 2016, Excel 2019
    Posts
    1,234

    Re: Using VLOOKUP across two sheets with multiple matches

    It may be easier, if you can combind both sheets into the same file.
    Then simply vlookup (or sumif) can slove your request.
    [cole]=vlookup(A2,Sheet2!$A$1:$C$4,3,false)[/code]

    Attachment 745319
    Regards.

  5. #5
    Registered User
    Join Date
    08-24-2021
    Location
    Australia
    MS-Off Ver
    Office Pro Plus 2016
    Posts
    15

    Re: Using VLOOKUP across two sheets with multiple matches

    Thanks again... that worked :-)
    That's basically what I was doing but across two files and couldn't get it to work... probably also to do with the ! and $ signs I didn't have
    Much appreciated

  6. #6
    Forum Expert wk9128's Avatar
    Join Date
    08-15-2020
    Location
    Australia
    MS-Off Ver
    365 V2403 and WPS V2022
    Posts
    3,469

    Re: Using VLOOKUP across two sheets with multiple matches

    POST #2

    formula OK

    Please watch this animation teaching file FILE name as S9
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    08-24-2021
    Location
    Australia
    MS-Off Ver
    Office Pro Plus 2016
    Posts
    15

    Re: Using VLOOKUP across two sheets with multiple matches

    Thanks wk9128 ... never doubted your formula - just my interpretation!

  8. #8
    Registered User
    Join Date
    08-24-2021
    Location
    Australia
    MS-Off Ver
    Office Pro Plus 2016
    Posts
    15

    Re: Using VLOOKUP across two sheets with multiple matches

    Frustratingly, whilst I got the VLOOKUP than Menem posted to work in the example file, I now can't get it to work in my actual one!
    I have tried changing the cells so they are all number, or general, or text in the hope that might fix it but no luck, so have attached the actual file
    Sorry - you have both been very helpful - would you mind taking a look and see where I am going wrong?
    I am trying to populate column K in sheet1 (Cost) from column E in Sheet2 (cost), based on their common SKU - column A in both sheets
    Attached Files Attached Files

  9. #9
    Forum Expert wk9128's Avatar
    Join Date
    08-15-2020
    Location
    Australia
    MS-Off Ver
    365 V2403 and WPS V2022
    Posts
    3,469

    Re: Using VLOOKUP across two sheets with multiple matches

    worksheet name : Sheet1

    Cell K2 formula , Drag down

    HTML Code: 
    Last edited by wk9128; 08-24-2021 at 11:45 PM.

  10. #10
    Registered User
    Join Date
    08-24-2021
    Location
    Australia
    MS-Off Ver
    Office Pro Plus 2016
    Posts
    15

    Re: Using VLOOKUP across two sheets with multiple matches

    sorry - still no luck... that just gives me empty cells...
    Attached Files Attached Files

  11. #11
    Forum Expert wk9128's Avatar
    Join Date
    08-15-2020
    Location
    Australia
    MS-Off Ver
    365 V2403 and WPS V2022
    Posts
    3,469

    Re: Using VLOOKUP across two sheets with multiple matches

    Please remove the @ symbol in your formula first, and try again

  12. #12
    Registered User
    Join Date
    08-24-2021
    Location
    Australia
    MS-Off Ver
    Office Pro Plus 2016
    Posts
    15

    Re: Using VLOOKUP across two sheets with multiple matches

    Apologies if I have missed something... but there is no symbol..??

  13. #13
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    81,290

    Re: Using VLOOKUP across two sheets with multiple matches

    You don't see this?

    =IFERROR(VLOOKUP(--A2,--@Sheet2!$A$2:$F$107,5,),"")
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  14. #14
    Registered User
    Join Date
    08-24-2021
    Location
    Australia
    MS-Off Ver
    Office Pro Plus 2016
    Posts
    15

    Re: Using VLOOKUP across two sheets with multiple matches

    Wow... bizarre!... no that is 100% not in my formula!
    This is copy paste straight from the command line....
    =IFERROR(VLOOKUP(--A2,--Sheet1!A2:F107,5,),"")

    I would post an image, but can't....

  15. #15
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    81,290

    Re: Using VLOOKUP across two sheets with multiple matches

    This won't work properly:

    =IFERROR(VLOOKUP(--A2,--Sheet1!A2:F107,5,),"")

    It will need to be this:

    =IFERROR(VLOOKUP(--A2,--Sheet2!$A$2:$F$107,5,),"")

    or this:

    =IFERROR(VLOOKUP(--A2,--Sheet2!$A$2:$F$107,5,0),"")

  16. #16
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    81,290

    Re: Using VLOOKUP across two sheets with multiple matches

    Any luck?

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

    Also, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

  17. #17
    Registered User
    Join Date
    08-24-2021
    Location
    Australia
    MS-Off Ver
    Office Pro Plus 2016
    Posts
    15

    Re: Using VLOOKUP across two sheets with multiple matches

    Sorry... my mistake... I actually tried removing $'s to see what happened... pasted the wrong thing... I did actually have it like that..
    Here it is again... I notice that when I click up into the command bar, it highlights the A2 in blue, but not the Sheet2... like it should...
    I have typed the formula in manually, rather than cut/paste in case there is something happening.... but still no luck
    Attached Files Attached Files

  18. #18
    Registered User
    Join Date
    08-24-2021
    Location
    Australia
    MS-Off Ver
    Office Pro Plus 2016
    Posts
    15

    Re: Using VLOOKUP across two sheets with multiple matches

    Oh... and thanks for the tips... will definitely do all of that!

  19. #19
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    81,290

    Re: Using VLOOKUP across two sheets with multiple matches

    When I open your workbiook it appears like this:

    =IFERROR(VLOOKUP(--A2,--@Sheet2!$A$2:$F$107,5,),"")

    As soon as I remove the @ sign, it works. Try this:

    =IFERROR(VLOOKUP(--A2,Sheet2!$A$2:$F$107,5,0),"")
    Attached Files Attached Files
    Last edited by AliGW; 08-25-2021 at 03:05 AM.

  20. #20
    Registered User
    Join Date
    08-24-2021
    Location
    Australia
    MS-Off Ver
    Office Pro Plus 2016
    Posts
    15

    Re: Using VLOOKUP across two sheets with multiple matches

    Might also be worth noting, that when I received the email notification about AliGW's response, there were indeed @ symbols in the test of the email! But when I look at them in the forum response they are not there!!!

  21. #21
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    81,290

    Re: Using VLOOKUP across two sheets with multiple matches

    That's because I removed them (they were not meant to be there - it was a typo).

    See post #19.

  22. #22
    Registered User
    Join Date
    08-24-2021
    Location
    Australia
    MS-Off Ver
    Office Pro Plus 2016
    Posts
    15

    Re: Using VLOOKUP across two sheets with multiple matches

    Maybe my Excel is broken!!... either that or I am!! Still no luck.
    Thanks for all your help. I will try sending the files to another computer and try them at home tonight... see if I have any better luck... will let you know how I get on.

  23. #23
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    81,290

    Re: Using VLOOKUP across two sheets with multiple matches

    Did you open my attachment?

    Try repairing your Office installation if all else fails.

  24. #24
    Registered User
    Join Date
    08-24-2021
    Location
    Australia
    MS-Off Ver
    Office Pro Plus 2016
    Posts
    15

    Re: Using VLOOKUP across two sheets with multiple matches

    Aha.. ok - I went back to your post #19 and downloaded the file... and you are right.. it is exactly as it should be
    I'll try it at home tonight and see how I go....
    Thanks again

  25. #25
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    81,290

    Re: Using VLOOKUP across two sheets with multiple matches

    Please mark as solved (post #16).

  26. #26
    Registered User
    Join Date
    08-24-2021
    Location
    Australia
    MS-Off Ver
    Office Pro Plus 2016
    Posts
    15

    Re: Using VLOOKUP across two sheets with multiple matches

    I have marked as solved, Thanks AliGW...
    Though I would really mark it as semi-solved!
    Your copy of the spreadsheet does indeed work... but I can't figure out why mine doesn't... the @ symbol doesn't appear on my home computer when I open the file either.
    Anyway... once again - thanks

  27. #27
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    81,290

    Re: Using VLOOKUP across two sheets with multiple matches

    Are you using this:


    =IFERROR(VLOOKUP(--A2,--Sheet2!$A$2:$F$107,5,0),"")

    or this:


    =IFERROR(VLOOKUP(--A2,Sheet2!$A$2:$F$107,5,0),"")

    ???

    If the former, change to the latter. If this doesn't work, then there is an issue with your Excel installation, and that's beyond the scope of this thread (which should be marked as solved).

  28. #28
    Registered User
    Join Date
    08-24-2021
    Location
    Australia
    MS-Off Ver
    Office Pro Plus 2016
    Posts
    15

    Re: Using VLOOKUP across two sheets with multiple matches

    Aha!
    Thanks - that fixed it....

  29. #29
    Forum Expert wk9128's Avatar
    Join Date
    08-15-2020
    Location
    Australia
    MS-Off Ver
    365 V2403 and WPS V2022
    Posts
    3,469

    Re: Using VLOOKUP across two sheets with multiple matches

    You're Welcome. Glad to help . Thank You for the feedback

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Formula to count matches between multiple columns on different sheets w/ multiple criteria
    By RICK JAMES in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-05-2019, 03:28 PM
  2. Vlookup 2 sheets finding data that matches both
    By McCaughley7 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-05-2015, 04:19 PM
  3. Macro using VLOOKUP with multiple matches between multiple sheets
    By tripathy69 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-19-2014, 10:14 AM
  4. Lookup and return multiple matches across multiple sheets
    By somnath6309 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 09-07-2013, 02:44 AM
  5. Index/Match multiple sheets multiple matches
    By matt1971 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-28-2013, 06:49 AM
  6. Vlookup Multiple Sheets, Approximate Matches
    By maxymab in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-28-2013, 09:50 PM
  7. Macro using VLOOKUP with multiple matches between multiple sheets
    By Derrek0204 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-16-2011, 06:20 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1