+ Reply to Thread
Results 1 to 21 of 21

Automatic Top 10 Ranking by Date Reference

  1. #1
    Registered User
    Join Date
    02-28-2023
    Location
    UK
    MS-Off Ver
    365
    Posts
    4

    Question Automatic Top 10 Ranking by Date Reference

    Every day I run a report that identifies the reason someone contacted our team. I need to rank them daily and weekly on the top 10 reasons for contact. My data is in a format like the below example - please can I have suggestions on how to automate the ranking and sorting? I will need the reason code itself and the quantity on that date, sorted into top 10 most common.

    Currently we have a list of the reason codes and are doing a VLOOKUP based on the date/week # and sorting the results manually through a macro button. This becomes a pain if you need to add or change any of the reason codes - I know there has to be an easier way but my attempts at writing code to do what I need have failed.

    Thank you in advance.
    Attached Files Attached Files
    Last edited by samanthahernandez; 07-17-2023 at 10:28 AM. Reason: Solved

  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,213

    Re: Automatic Top 10 Ranking by Date Reference

    You talk about the top 10 reasons... and your raw data contains only 6.

    So... please a) be precise and b) populate your sheet with a few examples of WHAT you expect to see WHERE you expect so see it.
    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 Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2406 (Windows 11 23H2 64-bit)
    Posts
    81,483

    Re: Automatic Top 10 Ranking by Date Reference

    There are 23 reasons for week 1, Glenn (if I have interpreted it correctly)

    AliGW on MS365 Beta Channel (Windows 11) 64 bit

    K
    3
    1
    4
    2
    5
    3
    6
    4
    7
    7
    8
    8
    9
    9
    10
    10
    11
    12
    12
    16
    13
    17
    14
    24
    15
    28
    16
    29
    17
    32
    18
    33
    19
    42
    20
    80
    21
    84
    22
    97
    23
    115
    24
    125
    25
    137
    Sheet: Sheet1
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  4. #4
    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,213

    Re: Automatic Top 10 Ranking by Date Reference

    Ali... where on earth did you see that??

  5. #5
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2406 (Windows 11 23H2 64-bit)
    Posts
    81,483

    Re: Automatic Top 10 Ranking by Date Reference

    I see C3:H9 as the reasons for week 1 and C10:H16 as the reasons for week 2.

    I have got this far, but I am still useless trying to do COUNTIF with a dynamic array:

    =LET(f,FILTER(C3:H16,B3:B16=1),s,SORT(TOCOL(f,1,1)),u,UNIQUE(s),s)

  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,213

    Re: Automatic Top 10 Ranking by Date Reference

    Ahhh. No, I think C3 is the number of reasons A chosen on week 1 3rd July. We'll see, when a more complete explanation is provided

  7. #7
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2406 (Windows 11 23H2 64-bit)
    Posts
    81,483

    Re: Automatic Top 10 Ranking by Date Reference

    I agree - it could easily be that way around!

  8. #8
    Registered User
    Join Date
    02-28-2023
    Location
    UK
    MS-Off Ver
    365
    Posts
    4

    Re: Automatic Top 10 Ranking by Date Reference

    Apologies for the confusion all, my first time posting so I am sorry for not providing adequate information.

    The real world data has over 110 reasons for contact and is calculated every day of the year so a lot of data to work with.

    I've re-attached the example and included what the end goal would be, does this help?
    Attached Files Attached Files

  9. #9
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2406 (Windows 11 23H2 64-bit)
    Posts
    81,483

    Re: Automatic Top 10 Ranking by Date Reference

    By date could be this:

    =LET(h,C1:L1,v,VSTACK(h,FILTER(C3:L16,A3:A16=P1)),t,TRANSPOSE(SORTBY(v,INDEX(v,2,),-1)),HSTACK(SEQUENCE(ROWS(t),,1,1),t))

  10. #10
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2406 (Windows 11 23H2 64-bit)
    Posts
    81,483

    Re: Automatic Top 10 Ranking by Date Reference

    And by week:

    =LET(h,C1:L1,f,FILTER(C3:L16,B3:B16=U1),v,VSTACK(h,BYCOL(f,LAMBDA(x,SUM(x)))),t,TRANSPOSE(SORTBY(v,INDEX(v,2),-1)),HSTACK(SEQUENCE(ROWS(t),,1,1),t))
    Attached Files Attached Files

  11. #11
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2406 (Windows 11 23H2 64-bit)
    Posts
    81,483

    Re: Automatic Top 10 Ranking by Date Reference

    All in one:

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by AliGW; 07-17-2023 at 10:27 AM.

  12. #12
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,126

    Re: Automatic Top 10 Ranking by Date Reference

    Another option.
    For daily
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    and for weekly
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  13. #13
    Registered User
    Join Date
    02-28-2023
    Location
    UK
    MS-Off Ver
    365
    Posts
    4

    Re: Automatic Top 10 Ranking by Date Reference

    Quote Originally Posted by Fluff13 View Post
    Another option.
    For daily
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    and for weekly
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Amazing, thank you!

  14. #14
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2406 (Windows 11 23H2 64-bit)
    Posts
    81,483

    Re: Automatic Top 10 Ranking by Date Reference

    Administrative Note

    ... please don't ignore contributors to your thread - it takes members time to provide suggestions, so acknowledge all solutions offered, even if they don't meet your requirements. Thanks.

    If that takes care of your original question, please choose Thread Tools from the menu link above and mark this thread as SOLVED.

    Also, if you have not already done so, you may not be aware that you can thank anyone who offered you help towards a solution for your issue by clicking the small star icon (* Add Reputation) located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of all those who offered help.

  15. #15
    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,213

    Re: Automatic Top 10 Ranking by Date Reference

    and merely 'cos I got there:

    =LET(A,TOCOL(C1:L1),B,TOCOL(FILTER(C3:L16,A3:A16=P1)),C,HSTACK(A,B),D,FILTER(C,INDEX(C,,2)<>" "),E,TAKE(SORTBY(D,INDEX(D,,2),-1,INDEX(D,,1),1),10),F,SEQUENCE(ROWS(E)),HSTACK(F,E))

    and

    =LET(A,TOCOL(C1:L1),B,TOCOL(BYCOL(FILTER(C3:L16,B3:B16=W1),LAMBDA(x,SUM(x)))),C,HSTACK(A,B),D,FILTER(C,INDEX(C,,2)<>" "),E,TAKE(SORTBY(D,INDEX(D,,2),-1,INDEX(D,,1),1),10),F,SEQUENCE(ROWS(E)),HSTACK(F,E))
    Attached Files Attached Files

  16. #16
    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,213

    Re: Automatic Top 10 Ranking by Date Reference

    Incidentally, neither of the other solutions work for 3rd July

  17. #17
    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,213

    Re: Automatic Top 10 Ranking by Date Reference

    Nor do they sort tied values alphabetically... So don't forget to check Post 15....

  18. #18
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,126

    Re: Automatic Top 10 Ranking by Date Reference

    Incidentally, neither of the other solutions work for 3rd July
    Good spot.
    So my formula would be
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  19. #19
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,126

    Re: Automatic Top 10 Ranking by Date Reference

    Amazing, thank you!
    Glad to help & thanks for the feedback.

  20. #20
    Registered User
    Join Date
    02-28-2023
    Location
    UK
    MS-Off Ver
    365
    Posts
    4

    Re: Automatic Top 10 Ranking by Date Reference

    Quote Originally Posted by AliGW View Post
    All in one:

    Please Login or Register  to view this content.

    Quote Originally Posted by Glenn Kennedy View Post
    and merely 'cos I got there:

    =LET(A,TOCOL(C1:L1),B,TOCOL(FILTER(C3:L16,A3:A16=P1)),C,HSTACK(A,B),D,FILTER(C,INDEX(C,,2)<>" "),E,TAKE(SORTBY(D,INDEX(D,,2),-1,INDEX(D,,1),1),10),F,SEQUENCE(ROWS(E)),HSTACK(F,E))

    and

    =LET(A,TOCOL(C1:L1),B,TOCOL(BYCOL(FILTER(C3:L16,B3:B16=W1),LAMBDA(x,SUM(x)))),C,HSTACK(A,B),D,FILTER(C,INDEX(C,,2)<>" "),E,TAKE(SORTBY(D,INDEX(D,,2),-1,INDEX(D,,1),1),10),F,SEQUENCE(ROWS(E)),HSTACK(F,E))
    Thank you both! I'm so glad I asked as these are definitely far beyond my formula knowledge - Whew!

  21. #21
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2406 (Windows 11 23H2 64-bit)
    Posts
    81,483

    Re: Automatic Top 10 Ranking by Date Reference

    If you want an explanation of any of them, just ask.

+ 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. Automatic ranking
    By drillguy in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-06-2023, 04:41 AM
  2. Automatic ranking standings
    By Clau46 in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 04-24-2022, 10:42 PM
  3. Replies: 8
    Last Post: 04-26-2020, 12:00 PM
  4. [SOLVED] codes for automatic saving with cell reference and date
    By ash3angel in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-24-2015, 05:35 AM
  5. Automatic Ranking
    By Nathaniel82 in forum Excel General
    Replies: 1
    Last Post: 05-22-2009, 08:06 AM
  6. Automatic Update from a site and automatic ranking-Possible?
    By striker_rage in forum Excel General
    Replies: 3
    Last Post: 12-01-2008, 11:34 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