+ Reply to Thread
Results 1 to 7 of 7

Match two cells returning data from third cell

  1. #1
    Forum Contributor
    Join Date
    10-13-2011
    Location
    Australia
    MS-Off Ver
    Office 16
    Posts
    329

    Match two cells returning data from third cell

    Hi all
    I've been trying to find a quick solution to this with no avail.
    Wonder if someone can assist. I have 2 sheets, want to match data in columns B and C of Export sheet with Columns A and B of Lookup sheet, with the matched result being the data from Column C of Lookup into column A of the export sheets.
    Small sample provided, my database has around 500 entries and am thinking a vlookup/match query?
    Thanks in advance for any help you can provide.
    Attached Files Attached Files
    Last edited by Christopherdj; 07-27-2020 at 06:05 PM.

  2. #2
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,463

    Re: Match two cells returning data from third cell

    Try:

    Please Login or Register  to view this content.
    Quang PT

  3. #3
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,872

    Re: Match two cells returning data from third cell

    Result as below. Brought each table into Power Query. Joined tables with outer join

    Excel 2016 (Windows) 32 bit
    E
    F
    G
    1
    Heading 1 Heading 2 Export.Heading 1
    2
    ghi CD 1234A
    3
    def AB 6543F
    4
    stu KL 8765R
    5
    jkl EF 987U
    6
    mno GH 57648Z
    7
    pqr IJ 982L
    Sheet: Lookup

    Mcode for join
    Please Login or Register  to view this content.
    Review PQ
    In the attached file
    Click on any cell in the new table
    On the Data Tab, click on Queries & Connections
    In the right window, double click to open Query
    Review PQ steps

    M-code basics:
    - "let" is the start of a query
    - "in" is the closing of a query
    - each transformation step sits in between those 2 lines
    - each step line is ended by a comma, except the last one
    - "Source" is always the first step (Source Data)
    - After "in" you have the last step referenced
    Attached Files Attached Files
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  4. #4
    Forum Contributor
    Join Date
    10-13-2011
    Location
    Australia
    MS-Off Ver
    Office 16
    Posts
    329

    Re: Match two cells returning data from third cell

    OH WOW, thanks for the quick solution/s to you both. Solves my problem on both solutions. Thank you so very much.

  5. #5
    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
    80,656

    Re: Match two cells returning data from third cell

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.
    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.

  6. #6
    Forum Contributor
    Join Date
    10-13-2011
    Location
    Australia
    MS-Off Ver
    Office 16
    Posts
    329

    Re: Match two cells returning data from third cell

    Oops, closed it off too soon.
    bebo021999 your formula worked fine in the example sheet, however when I add to my actual, all I get is #N/A result.
    If you change the sheet "Lookup" to "DATA", it may help me to understand, using the word lookup has made the code a little confusing.

    I also don't want it restricted to rows 2 and 7 only, so I know I can amend it to $A:$A etc. but there is an issue I can't seem to fix.
    As stipulated in my original post, there are over 500 entries to try to match.

  7. #7
    Forum Contributor
    Join Date
    10-13-2011
    Location
    Australia
    MS-Off Ver
    Office 16
    Posts
    329

    Re: Match two cells returning data from third cell

    My apologies once again, it seems when a result is #N/A it usually means there is something wrong with the data source. I woke during the night with the issue - it was with my data between the two sheets. I can modify your result to meet my needs, now solving this and again my sincere apologies for any confusion - it was my error not yours.

+ 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] Index match - not returning data (for all cells)
    By rayted in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 11-06-2017, 07:41 AM
  2. Replies: 11
    Last Post: 01-12-2016, 03:30 PM
  3. Replies: 1
    Last Post: 06-19-2015, 12:52 AM
  4. Returning Multiple Cells of Data into One Cell
    By Arletta in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-17-2013, 12:32 PM
  5. Replies: 6
    Last Post: 05-01-2013, 10:10 AM
  6. Returning the contents of a specific cell using a MATCH of 2 other cells
    By oneblondebrow in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 04-08-2013, 08:41 AM
  7. Finding matching cells then returning data of another cell
    By GenericPat in forum Excel Formulas & Functions
    Replies: 19
    Last Post: 11-19-2012, 03:36 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