+ Reply to Thread
Results 1 to 6 of 6

List Unique Values Based On Criteria

  1. #1
    Registered User
    Join Date
    01-07-2014
    Location
    England
    MS-Off Ver
    Excel 2016
    Posts
    41

    List Unique Values Based On Criteria

    Hi all,

    I am hoping for some assistance with a formula that I am trying to create.

    I have a query that is returning many rows of data, but I need a formula to do the following;

    I need a list of all unique values in column E, if the corresponding rows in column D equals a value in $A$1.

    Would then want these unique values to list across columns from G1 to T1 (or maybe more depending on the number of values).

    I have attached an example.Checks.xlsx

    I hope this makes sense.

    Thanks in advance.

    TM.
    Attached Files Attached Files

  2. #2
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: List Unique Values Based On Criteria

    Hi.

    In G1, array formula**:

    =IFERROR(SMALL(IF(FREQUENCY(IF($D$2:$D$9=$A$1,$E$2:$E$9),$E$2:$E$9),$E$2:$E$9),COLUMNS($A:A)),"")

    Copy across as required.

    I used a rather lazy IFERROR approach since it appears that you do not have a very large dataset.

    Regards


    **Array formulas are not entered in the same way as 'standard' formulas. Instead of pressing just ENTER, you first hold down CTRL and SHIFT, and only then press ENTER. If you've done it correctly, you'll notice Excel puts curly brackets {} around the formula (though do not attempt to manually insert these yourself).
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  3. #3
    Registered User
    Join Date
    01-07-2014
    Location
    England
    MS-Off Ver
    Excel 2016
    Posts
    41

    Re: List Unique Values Based On Criteria

    Superb! Exactly what I needed, thanks

    The spreadsheet that I attached was only an example, my actual dataset is far, far larger.

    What other approach might be better other than the 'IFERROR'?

    TM

  4. #4
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: List Unique Values Based On Criteria

    No problems, but in that case shouldn't you be arranging to have these values returned into a single column, rather than a single row?

    Regards

  5. #5
    Registered User
    Join Date
    01-07-2014
    Location
    England
    MS-Off Ver
    Excel 2016
    Posts
    41

    Re: List Unique Values Based On Criteria

    Normally, yes.

    I just need these values to return in a row as it will form part of a report. I will then attached lookups to this row to return additional data.

  6. #6
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: List Unique Values Based On Criteria

    Then the most efficient method would be to put a single, non-array formula in e.g. F1, used to determine the expected number of returns:

    =SUMPRODUCT((D2:D9=A1)/COUNTIF(E2:E9,E2:E9))

    (Assumes there are no blanks in the range, just as in your attached example.)

    Your array formula** in G1 is then:

    =IF(COLUMNS($A:A)>$F$1,"",SMALL(IF(FREQUENCY(IF($D$2:$D$9=$A$1,$E$2:$E$9),$E$2:$E$9),$E$2:$E$9),COLUMNS($A:A)))

    and copied to the right.

    Regards

+ 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. [SOLVED] Counting Number of Unique Values in a List based on Criteria
    By greencroft in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 04-03-2014, 04:00 AM
  2. [SOLVED] Create list based on criteria and is unique
    By joannelittell in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 10-13-2013, 02:33 PM
  3. [SOLVED] Extract unique values out of list based on an extra criteria
    By sven1975 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-11-2012, 05:02 AM
  4. Unique dropdown list based on two criteria but...
    By Darsk in forum Excel General
    Replies: 2
    Last Post: 09-28-2011, 04:37 PM
  5. Replies: 2
    Last Post: 09-28-2011, 08:43 AM

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