+ Reply to Thread
Results 1 to 5 of 5

Using vlookup to update a cell from data in another cell based on matching two other cells

  1. #1
    Registered User
    Join Date
    10-18-2022
    Location
    South Carolina
    MS-Off Ver
    Office 365
    Posts
    5

    Using vlookup to update a cell from data in another cell based on matching two other cells

    Greetings,
    I apologize, my sample spreadsheet did not contain the proper data to test, it did not have matching sku's in both tabs. I have corrected it and uploaded again.

    Not sure if I should post this under formulas or VBA because I don't know if a formula or VBA script will work better so I posted in General.

    Basically I need to update the corresponding cell in column AE in tab 'BC Inventory' from the cell in column D in tab 'Bin number source' based on matching the 'sku' cells in the two tabs.
    But I only want the cells updated that are labeled SKU in column A of the 'BC Inventory' tab.

    Thank you in advance for any help.

    Glenn
    Attached Files Attached Files
    Last edited by Glenncobb61; 02-18-2023 at 10:03 AM. Reason: Title change per mods

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,328

    Re: Probably an xlookup but VBA might be better...

    1. Inventory, column A has a PILE of leading spaces before SKU.

    2. Delete all values from AE2 doown.

    3. If you O365 supports the MAP function you can use this:

    =MAP(A2:A14,C2:C14,LAMBDA(x,y,IF(TRIM(x)="SKU",VLOOKUP(y,'Bin number source'!A:D,4,FALSE),"")))

    4. If the leading spaces are not there (or are easily removed), it's always better to use clean data, the TRIM can be omitted.

    =MAP(A2:A14,C2:C14,LAMBDA(x,y,IF(x="SKU",VLOOKUP(y,'Bin number source'!A:D,4,FALSE),"")))

    All in one cell, no formula dragging...
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,946

    Re: Probably an xlookup but VBA might be better...

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however the thread title does not really convey what your request is about. Tell us what you are trying to do, not how you think it should be done.

    Please take a moment to amend your thread title. Make sure that the title properly explains your request. Your title should be explicit and not be generic (this includes function names used without an indication of what you are trying to achieve).

    Please see Forum Rule #1 about proper thread titles and adjust accordingly. To edit the thread title, open the original post to edit and then click on Go Advanced (bottom right) to access the area where you can edit your title.

    (Note: this change is not optional. No help to be offered until this moderation request has been fulfilled.)
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Registered User
    Join Date
    10-18-2022
    Location
    South Carolina
    MS-Off Ver
    Office 365
    Posts
    5

    Re: Probably an xlookup but VBA might be better...

    Title updated as requested. I have also read the forum rules, should have done that before...

    Thank you

  5. #5
    Registered User
    Join Date
    10-18-2022
    Location
    South Carolina
    MS-Off Ver
    Office 365
    Posts
    5

    Re: Probably an xlookup but VBA might be better...

    I was unaware that leading spaces cause problems. I can make duplicate columns and trim them to work with. Having the formula in one cell at the top is nice, simple.

    Thank you very much.

    Glenn

+ 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] XLOOKUP gives N/A
    By Hexdax in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 08-23-2022, 04:06 AM
  2. [SOLVED] if and xlookup
    By pickslides in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-16-2022, 07:24 AM
  3. If this do this XLOOKUP otherwise do this XLOOKUP
    By MattKoleczko in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-21-2022, 08:14 AM
  4. [SOLVED] Xlookup in PQ
    By Excelski in forum Excel General
    Replies: 7
    Last Post: 09-09-2021, 07:15 AM
  5. Two-way Xlookup
    By Ballet4ever in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-28-2021, 10:11 PM
  6. [SOLVED] Xlookup with VBA, need some help!
    By CSimm in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-19-2021, 03:14 PM
  7. Xlookup & sum
    By lynusann in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-19-2020, 11:04 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