+ Reply to Thread
Results 1 to 8 of 8

Extract data from range by matching

  1. #1
    Registered User
    Join Date
    06-28-2013
    Location
    Australia
    MS-Off Ver
    MS Office 2013
    Posts
    18

    Extract data from range by matching

    Hi all,

    I am trying to extract data from a column based on the information of two columns. In this picture http://i.imgur.com/2IbOKjO.jpg, the left and middle panels represent my current data.

    I would like to extract "Number" from the middle panel, based on the "Name" and "Year" of my left panel, to create a table like the one on the right panel of the picture.

    I have attached the excel file for your convenience.

    Thank you.

    Alex
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    04-29-2012
    Location
    Florida, USA
    MS-Off Ver
    2010, 2013
    Posts
    34

    Re: Extract data from range by matching

    Hi Alex,

    So you already have Name and Year in a column, and want to find the corresponding Number from column G? If so, enter this in C2 and fill down:

    Please Login or Register  to view this content.
    Attached is the Excel file if it helps.
    Attached Files Attached Files

  3. #3
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Extract data from range by matching

    Try this...

    Entered in C2 and copied down as needed:

    =INDEX(G$2:G$12,MATCH(A2,E$2:E$12,0)+COUNTIF(A$2:A2,A2)-1)
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  4. #4
    Registered User
    Join Date
    06-28-2013
    Location
    Australia
    MS-Off Ver
    MS Office 2013
    Posts
    18

    Re: Extract data from range by matching

    SteelReyn: Thank you so much that works very well!

    Tony Valko: The formula works fine for the attached data thank you! But for some reason, when I extended the range in the formula, the "Number" doesn't match correctly.

  5. #5
    Banned User!
    Join Date
    10-14-2006
    Posts
    1,211

    Re: Extract data from range by matching

    C2: =sumifs(g:g,e:e,a2,f:f,b2)

  6. #6
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Extract data from range by matching

    Quote Originally Posted by alexpsyched View Post
    Tony Valko: The formula works fine for the attached data thank you! But for some reason, when I extended the range in the formula, the "Number" doesn't match correctly.
    The formula is based on the fact that the data in the sample file is sorted. If your real data is not sorted then the formula will not work correctly.

    If the combination of name plus year is unique then I think TM's suggestion is the way to go.

  7. #7
    Registered User
    Join Date
    06-28-2013
    Location
    Australia
    MS-Off Ver
    MS Office 2013
    Posts
    18

    Re: Extract data from range by matching

    Thanks for clarifying. I should've been more clear in my question.

  8. #8
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Extract data from range by matching

    You're welcome!

    Good luck!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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