+ Reply to Thread
Results 1 to 6 of 6

Pull Certain Categories From List with INDEX + MATCH

  1. #1
    Registered User
    Join Date
    06-21-2013
    Location
    west allis
    MS-Off Ver
    Excel 2007
    Posts
    28

    Pull Certain Categories From List with INDEX + MATCH

    Good Afternoon,

    I am attempting to isolate my automobile expenditures from all other expenses. Currently, I am using an index + match formula that is attempting to extract only gasoline purchases. This will eventually be on a separate tab, but not necessary to solve my problem. The issue is excel is only pulling the first gasoline purchase and not pulling out the ones from different/later dates.

    I have attached the spreadsheet. Any thoughts or suggestions?

    Thanks
    Attached Files Attached Files

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

    Re: Pull Certain Categories From List with INDEX + MATCH

    Hi and welcome to the forum

    index/match and vlookup normally will only return the very 1st match they find. However, try this approach to "trick" the function. In a helper column (I used F) use this, copied down...
    =C3&COUNTIF($C$3:C3,C3)
    (you can hide this column if you want)

    Then, in your table, use this, copied down and across...
    =IFERROR(INDEX(Sheet1!$B:$F,MATCH($H3&ROW(A1),Sheet1!$F:$F,0),MATCH(G$2,$B$2:$E$2,0)),"")
    note, you may have to format I as currency after the copy/paste
    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

  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: Pull Certain Categories From List with INDEX + MATCH

    Here's my offering...

    Enter this array formula** in G3:

    =IFERROR(INDEX($B:$E,SMALL(IF($C$3:$C$68="gasoline",ROW(C$3:C$68)),ROWS(G$3:G3)),COLUMNS($G3:G3)),"")

    ** array formulas need to be entered using the key
    combination of CTRL,SHIFT,ENTER (not just ENTER).
    Hold down both the CTRL key and the SHIFT key
    then hit ENTER.

    Copy across to J3 then down until you get blanks.

    Format column G as Date.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

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

    Re: Pull Certain Categories From List with INDEX + MATCH

    You can make this dynamic by using a drop down list to select the category and then refer to that cell.

    F2 = drop down list of categories

    =IFERROR(INDEX($B:$E,SMALL(IF($C$3:$C$68=$F$2,ROW(C$3:C$68)),ROWS(G$3:G3)),COLUMNS($G3:G3)),"")

  5. #5
    Registered User
    Join Date
    06-21-2013
    Location
    west allis
    MS-Off Ver
    Excel 2007
    Posts
    28

    Re: Pull Certain Categories From List with INDEX + MATCH

    Thanks Tony! This is a very nice fix.

  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: Pull Certain Categories From List with INDEX + MATCH

    You're welcome. Thanks for the feedback!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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