+ Reply to Thread
Results 1 to 6 of 6

Matching two columns to return one value

  1. #1
    Registered User
    Join Date
    03-06-2014
    Location
    Cincinnati, Ohio
    MS-Off Ver
    Excel 2010
    Posts
    9

    Matching two columns to return one value

    Alright, so I need data in column A(Last names) and data in column B(First name) to match their respective names on another sheet. When a match is made, it will return column C(Hours worked).

    I originally used Vlookup to match last names, something akin to =VLOOKUP(A:A,Week1!A:P,4,FALSE)

    But this does not account for employees that may have the same last names. Is there a way to combine two vlookup's? Or is Index a possible solution?

    Thank you.

  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. 2406 (Windows 11 23H2 64-bit)
    Posts
    82,813

    Re: Matching two columns to return one value

    We need to see the workbook, please.
    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
    Registered User
    Join Date
    03-06-2014
    Location
    Cincinnati, Ohio
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Matching two columns to return one value

    Book2.xlsx

    Here is a snap-shot. Sheet2 must search column A and B from sheet1 to match First and Last names. Then the value returned is column C.

  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. 2406 (Windows 11 23H2 64-bit)
    Posts
    82,813

    Re: Matching two columns to return one value

    Add a helper column in column C of sheet 1 that concatenates A2 and B2 (=A2&B2) and drag down. Now add this into C2 of sheet 2 and drag down:

    =VLOOKUP((A3&B3),SHEET1!C2:D7,2,FALSE)

  5. #5
    Registered User
    Join Date
    03-15-2013
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    36

    Re: Matching two columns to return one value

    The attached should do the trick

    6.xlsx

  6. #6
    Valued Forum Contributor AZ-XL's Avatar
    Join Date
    03-22-2013
    Location
    Azerbaijan, Baku
    MS-Off Ver
    Excel 2007
    Posts
    603

    Re: Matching two columns to return one value

    Hi
    If Names in sheet1 is unique (example if Allen Jacob is only) then you can use sumifs function
    =SUMIFS(SHEET1!C:C,SHEET1!A:A,A3,SHEET1!B:B,B3)

    Formula below will bring first met criteria
    =IFERROR(INDEX(SHEET1!C:C,MATCH(SHEET2!A3&SHEET2!B3,SHEET1!A:A&SHEET1!B:B,0)),"") Ctrl+Shift+Enter
    Instead of second formula you can use the formula above. Its just an alternative
    Appreciate the help? CLICK *

+ 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. Replies: 2
    Last Post: 07-17-2013, 11:48 AM
  2. Matching data in 2 columns, in two sheets, return value
    By LD12345 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 07-11-2013, 12:06 PM
  3. [SOLVED] Return value based on matching across multiple columns
    By cde1983 in forum Excel General
    Replies: 3
    Last Post: 12-20-2011, 09:34 PM
  4. Loop through rows and return matching columns
    By ezzy85 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 01-11-2009, 11:21 PM
  5. Matching data in 2 columns to return 1.
    By butterflymaiden in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 04-18-2008, 06:37 AM

Tags for this Thread

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