+ Reply to Thread
Results 1 to 9 of 9

Horizontally Looking Up Values From One Sheet To Another And Matching on 2 Columns

  1. #1
    Forum Contributor
    Join Date
    06-18-2010
    Location
    USA
    MS-Off Ver
    Excel 2016
    Posts
    546

    Horizontally Looking Up Values From One Sheet To Another And Matching on 2 Columns

    I tried an index match, and the hlookup, but am just not quite getting the results returned I am after. I have data that spans all the way over to AF column, and I want to pull over the value requested to the master workbook.

    Attached is a sample workbook, what vba, and/or worksheet function could achieve this?

    Further Explenation, On Sheet1 I want to look up the numeric value from the row that matches ID 42123 and matches the value ABCDEFF and return that to C2 from sheet2, then match on the ID 42123 and match on the value RSTLMNO and return the value to F2 from sheet2

    So expected returned results would be:
    42123 ABCDEFF 18 RSTLMNO 1
    49182 ZZYY 4 BBCCC 3

    What formula would achieve that result?
    Attached Files Attached Files
    Last edited by jo15765; 02-15-2018 at 11:52 AM.

  2. #2
    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,978

    Re: Excel Lookup

    You have been a member here for eight years and ought to know the rules.

    Please take a moment to re-read forum rule #1 and then amend your thread title to something that better explains your problem. Changing your thread title is not optional, which means you must change it. Thanks!

    • Use concise, accurate thread titles.
    • Your post title should describe your problem, not your anticipated solution.
    • Use terms appropriate to a Google search - poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice tell us nothing.
    • Responding to a request to change your thread title by doing so is mandatory.

    To change a title go to your first post, click EDIT then Go Advanced and change your title.

    No help to be offered, please, until the OP complies with this request.
    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.

  3. #3
    Forum Contributor
    Join Date
    06-18-2010
    Location
    USA
    MS-Off Ver
    Excel 2016
    Posts
    546

    Re: Excel Lookup

    @AliGW - so sorry that was a definite copy/paste fail on my part. I apologize, and have made the update!

  4. #4
    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,978

    Re: Horizontally Looking Up Values From One Sheet To Another And Matching on 2 Columns

    Better - thanks.

  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,978

    Re: Excel Lookup

    Sorry - I haven't a clue what you are trying to do. There is no data in C2 Sheet2, so what are you expecting to see there?

    Please explain the LOGIC of what you are trying to do.

  6. #6
    Forum Contributor
    Join Date
    06-18-2010
    Location
    USA
    MS-Off Ver
    Excel 2016
    Posts
    546

    Re: Horizontally Looking Up Values From One Sheet To Another And Matching on 2 Columns

    I want to match on the ID, and the Value from Sheet1 and return the numeric value from Sheet2.

    From Sheet1 the first lookup would be on ID 42123 value ABCDEFF - now let's flip to Sheet2 and find the corresponding numeric value (which is in J2) 36, and I want to have that value input into Sheet1 cell C2, then we would look up 42123 value RSTLMNO and on Sheet2 the value is in N2, so I would want 99 in Sheet1 cell F2

    Does that clarify?

  7. #7
    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,978

    Re: Horizontally Looking Up Values From One Sheet To Another And Matching on 2 Columns

    OK - could you please manually add your expected results to Sheet1 and post the attachment again?

    The data layout is not conducive - is there scope to improve that?

  8. #8
    Forum Contributor
    Join Date
    06-18-2010
    Location
    USA
    MS-Off Ver
    Excel 2016
    Posts
    546

    Re: Horizontally Looking Up Values From One Sheet To Another And Matching on 2 Columns

    Unfortunately not. This is how the data is received and we must turn around and manipulate it into the format that I am seeking assistance here with.

    Attached is an updated workbook with the desired results on Sheet1
    Attached Files Attached Files

  9. #9
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,570

    Re: Horizontally Looking Up Values From One Sheet To Another And Matching on 2 Columns

    As Ali points out the data layout is not conducive to analysis, so the first thing this proposed solution does is to copy the data into a more analysis friendly table which may be placed in an inconspicuous portion of the sheet, or hidden, for aesthetic purposes.
    Step 1: Count the records in each row using (this assumes that each text entry is paired with a preceding numeric entry): =COUNT(B2:O2)
    Step 2: Set up a column of repetitive reference numbers using the array entered formula*:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Step 3: Set up a column of texts associated with the reference numbers using:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Step 4: Set up a column of numeric values associated with each text value using:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    The numeric values are displayed in the cells on sheet 1 using the array entered formula*:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    *Array entered formulas are confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer.
    Let us know if you have any questions.
    Attached Files Attached Files
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

+ 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. Fuzzy Lookup for Excel & Excel 2016 (possible bug)
    By something_else in forum Excel General
    Replies: 10
    Last Post: 10-11-2017, 03:37 AM
  2. Two Lookup and Return (Lookup the column, then lookup the row)
    By Branbran10 in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 08-05-2015, 04:55 PM
  3. Replies: 2
    Last Post: 05-19-2013, 08:46 AM
  4. Excel Lookup
    By [email protected] in forum Excel General
    Replies: 11
    Last Post: 01-09-2012, 03:25 AM
  5. lookup in excel
    By abhi234u in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-10-2007, 10:44 AM
  6. SOS!!! lookup Excel vs Outlook? Record messages to Excel
    By LanaWhite in forum Excel General
    Replies: 2
    Last Post: 08-03-2005, 04:05 AM
  7. [SOLVED] Need help with Excel Lookup
    By tdmcmhaon in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-07-2005, 12:06 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