+ Reply to Thread
Results 1 to 4 of 4

Extracting multiple unique values from a table based on a single criterion.

  1. #1
    Registered User
    Join Date
    07-04-2012
    Location
    UK
    MS-Off Ver
    Excel 2010
    Posts
    27

    Extracting multiple unique values from a table based on a single criterion.

    Hey all,

    I have seen similar problems to mine and I know I would have to use a mix of INDEX, MATCH and COUNTIF functions but unfortunately I just cannot get my head around the correct formulae.

    I have attached a spreadsheet with the database and 2 samples with examples of input and output.

    Thanks,
    Al
    Attached Files Attached Files

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,679

    Re: Extracing multiple unique values from a table based on a single criterion.

    Put this formula in cell J4:

    =IF(F4=$D$17,MAX(J$3:J3)+1,"-")

    and copy it down to the bottom of your data (or beyond if you want to add new data). Then you can use this formula in cell C20:

    =IFERROR(INDEX(C:C,MATCH(ROWS($1:1),$J:$J,0)),"")

    Copy this across into D20:F20, but then amend the formula in F20 to this:

    =IFERROR(INDEX(I:I,MATCH(ROWS($1:1),$J:$J,0)),"")

    and then you can copy the formulae in D20:F20 down as far as you need to.

    Then, when you change the value in D17 the display will automatically change.

    Hope this helps.

    Pete

  3. #3
    Registered User
    Join Date
    07-04-2012
    Location
    UK
    MS-Off Ver
    Excel 2010
    Posts
    27

    Re: Extracting multiple unique values from a table based on a single criterion.

    Thanks Pete, that is a nice solution.

    Unfortunately I need both samples to work at the same time, otherwise I would have to do a lot of manual workarounds in my original spreadsheet.

    Cheers,
    Al

  4. #4
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,679

    Re: Extracting multiple unique values from a table based on a single criterion.

    Well, you could use a second helper column, with this formula in K4:

    =IF(F4=$D$26,MAX(K$3:K3)+1,"-")

    and this formula in C29:

    =IFERROR(INDEX(C:C,MATCH(ROWS($1:1),$K:$K,0)),"")

    as the attached file demonstrates.

    Hope this helps.

    Pete
    Attached Files Attached Files

+ 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: 06-16-2016, 08:09 PM
  2. **SOLVED**Extracting Unique Values Based On The Value In A Cell
    By rlh06 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 10-09-2014, 09:43 AM
  3. [SOLVED] Looking up multiple values based on a single criterion
    By wmjenner in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-31-2013, 09:38 PM
  4. Replies: 6
    Last Post: 10-17-2012, 07:32 PM
  5. Extracting unique entries from table with multiple rows and columns
    By Bonnister in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-04-2012, 11:48 AM
  6. VBA.array to sum values based on multiple criterion and dates
    By Varmark in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-03-2011, 09:33 PM
  7. [SOLVED] Find Multiple instances of Single Criterion in Row & Return To a Single Col
    By Sam via OfficeKB.com in forum Excel Formulas & Functions
    Replies: 16
    Last Post: 05-09-2006, 10:10 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