+ Reply to Thread
Results 1 to 12 of 12

Unique return based on data in adjacent column values and return averages

  1. #1
    Forum Contributor
    Join Date
    07-10-2012
    Location
    United States
    MS-Off Ver
    Office 365
    Posts
    456

    Unique return based on data in adjacent column values and return averages

    Hello,

    I have an example attached. (notes in file)

    I am looking to pulls unique customer ID's based on a value in an adjacent column (and for unique customers ID's that have two or more entries) and average all returns in other adjacent columns.

    This is pretty complicated, I appreciate any help.

    Thank you,
    Attached Files Attached Files

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Unique return based on data in adjacent column values and return averages

    Your WORDS can be interpreted in a couple of different ways. This MIGHT be what you want for the ID. Please populate your sample with manually calculated expected answers, to remove pointless guesswork.

    =UNIQUE(FILTER(Table1[CUSTOMER ID],(Table1[NPS]>=7)*(Table1[NPS]<=8)*(COUNTIF(Table1[CUSTOMER ID],Table1[CUSTOMER ID])>1)))
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  3. #3
    Forum Contributor
    Join Date
    07-10-2012
    Location
    United States
    MS-Off Ver
    Office 365
    Posts
    456

    Re: Unique return based on data in adjacent column values and return averages

    Thank you for the feedback Glenn.

    I attached an updated example that has return values.
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    09-25-2015
    Location
    Milan Italy
    MS-Off Ver
    office 365
    Posts
    1,982

    Re: Unique return based on data in adjacent column values and return averages

    Spilled array formulas aren't supported in Excel tables. Try moving your formula out of the table, or converting the table to a range (click Table Design > Tools > Convert to range)


    A12=UNIQUE(FILTER(Table1[CUSTOMER ID],ISNUMBER(MATCH(Table1[NPS],'DATA ENTRY'!B10:B11,0))))

    B12=IF($A12<>"",SUMPRODUCT(COUNTIFS(Table1[CUSTOMER ID],SUMMARY!$A12,Table1[NPS],'DATA ENTRY'!$B$10:$B$11)),"")

    Copy down

    C12=IFERROR(AVERAGEIFS('DATA ENTRY'!C$3:C$100,'DATA ENTRY'!$A$3:$A$100,SUMMARY!$A12,'DATA ENTRY'!$B$3:$B$100,">="&'DATA ENTRY'!$B$10),"")

    Copy across and down
    Attached Files Attached Files

  5. #5
    Forum Contributor
    Join Date
    07-10-2012
    Location
    United States
    MS-Off Ver
    Office 365
    Posts
    456

    Re: Unique return based on data in adjacent column values and return averages

    Hello, update attached. I removed the table from the filter worksheet.

    Is there a way to have the same filter formula pull the data across and down, currently in A2 to gather the values in columns B-F?

    My master copy may return results in the hundreds.

    Thanks for any help.

  6. #6
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Unique return based on data in adjacent column values and return averages

    There's a better way to do this... but my head's not working today.

    Convert the table to a range and delete ALL the expected answers. Then use this in A12:

    =LET(T,Table1,ID,INDEX(T,,1),NPs,INDEX(T,,2),UID,UNIQUE(FILTER(ID,(NPs>=7)*(NPs<=8)*(COUNTIF(ID,ID)>1))),n,COUNTIFS(ID,UID,NPs,">=7",NPs,"<=8"),F,AVERAGEIFS(INDEX(T,,3),ID,UID,NPs,">=7",NPs,"<=8"),G,AVERAGEIFS(INDEX(T,,4),ID,UID,NPs,">=7",NPs,"<=8"),D,AVERAGEIFS(INDEX(T,,5),ID,UID,NPs,">=7",NPs,"<=8"),C,AVERAGEIFS(INDEX(T,,6),ID,UID,NPs,">=7",NPs,"<=8"),CHOOSE({1,2,3,4,5,6},UID,n,F,G,D,C))
    Attached Files Attached Files

  7. #7
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Unique return based on data in adjacent column values and return averages

    I converted the data with power query.

    After that a formula to determine the criteria.

    After that a pivot table to get the result.


    You don't add the expected result in your file, so I can't check the result.


    See the attached file.
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  8. #8
    Forum Contributor
    Join Date
    07-10-2012
    Location
    United States
    MS-Off Ver
    Office 365
    Posts
    456

    Re: Unique return based on data in adjacent column values and return averages

    Glenn, that works perfect! Thank you.

  9. #9
    Forum Contributor
    Join Date
    07-10-2012
    Location
    United States
    MS-Off Ver
    Office 365
    Posts
    456

    Re: Unique return based on data in adjacent column values and return averages

    Hi, I already closed this thread, but I did run into one issue.

    I was looking only to display those who had 2 or more NPS of 7 and or 8.

    If there are two entries one being 7 and the other being for example 9, the customer id will be displayed with a result return of 1.

    I attached the example. I am able to work around this, but adding a sort to the formula and having it sort larger to small, but if there is a solution not to display that would work better.

    I appreciate the help on this, and as it is, I am able to use it in my workbook.

    thank you,
    Nick
    Attached Files Attached Files

  10. #10
    Forum Contributor
    Join Date
    07-10-2012
    Location
    United States
    MS-Off Ver
    Office 365
    Posts
    456

    Re: Unique return based on data in adjacent column values and return averages

    Actually, now that I am working with it, it may be useful to see who rated more than once, and how many of those were 7 or 8. Thank you!

  11. #11
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Unique return based on data in adjacent column values and return averages

    You don't add the expected result in your file, so I can't check the result.


    See the attached file.

  12. #12
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Unique return based on data in adjacent column values and return averages

    If you're still looking for help here, please upload a fresh sample file, with an explanation & expected results.

+ 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: 1
    Last Post: 01-26-2021, 02:29 AM
  2. Replies: 1
    Last Post: 01-26-2021, 02:29 AM
  3. [SOLVED] Return unique values based on other column
    By esbencito in forum Excel General
    Replies: 2
    Last Post: 05-31-2018, 02:47 AM
  4. Return Multiple Text Reslts Sorted Based Unique Values in another Column
    By Fin Fang Foom in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 12-10-2015, 12:01 AM
  5. Return number of unique values based on values in other column
    By Medir in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-26-2013, 11:17 AM
  6. [SOLVED] Return unique values based on another column's value
    By bd528 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 07-26-2013, 04:02 AM
  7. Replies: 19
    Last Post: 04-17-2013, 09:51 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