+ Reply to Thread
Results 1 to 17 of 17

Conditional Ranking with large data set

  1. #1
    Registered User
    Join Date
    03-21-2016
    Location
    New York, New York
    MS-Off Ver
    Microsoft Office Professional Plus 2010
    Posts
    8

    Conditional Ranking with large data set

    Hi Everyone,

    I have a large data set that includes multiple columns (Country, Name of Store, year to date sales, growth, etc.) and multiple rows (Australia, China, Hong Kong, etc.). I need to rank each store's sales but only within their country. However, I want the formula to expand all of the countries so I don't have to redo the formula every time a new store is open within a particular country. I've been trying to find a way to automate this because I will have to do this exercise every month.

    So far, I've tried SUMPRODUCT per other guidance with the below formula:
    =1+SUM(IF($A$6:$A$1800=A6,IF((G6+ROW(G6)*0.00001)>($G$6:$G$1800+ROW($G$6:$G$1800)*0.00001),1,0),0))

    However, it still gives me rankings for all countries. For example, if I am trying to rank the stores in China, it will still pop-up ranks for the stores in Australia. Ideally, I can use a formula that will just give me blanks when the rank formula is on the country that I am currently not ranking.

    Is there a "rankif" type formular that I could use for this?
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Conditional Ranking with large data set

    How about using a pviot Table? I used "Affiliate" as "Report Filter", "Retailer" as a row label and FY16 YTD actual in SUM Values twice (once as SUM, once as RANK Large to small). See attachment
    Attached Files Attached Files
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Registered User
    Join Date
    03-21-2016
    Location
    New York, New York
    MS-Off Ver
    Microsoft Office Professional Plus 2010
    Posts
    8

    Re: Conditional Ranking with large data set

    Hi - yes my original intent was to use a pivot table but there are about 10-20 new lines of data each month (as we open new stores) so the pivot table would have to be re-done every month, right? not ideal.

  4. #4
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Conditional Ranking with large data set

    We are just using Column G to rank? Try this formula

    =IF(A2="Australia", SUMPRODUCT(--($A$2:$A$138= "Australia"), --(G2<$G$2:$G$138)),"")

    If you set up your original data as a TABLE (Insert Table), then the data will automatically update. You would just need to "Refresh" the pivot table.

  5. #5
    Registered User
    Join Date
    03-21-2016
    Location
    New York, New York
    MS-Off Ver
    Microsoft Office Professional Plus 2010
    Posts
    8

    Re: Conditional Ranking with large data set

    Hi - thanks! Unforunately the formula didn't work. I just kept getting an error message.

    However, did not know about being able to set up my data as a table. So, anytime I import new data, as long as I'm pasting as values into the table, I won't have to recreate the pivot table, correct? That seems like the easiest solution!

  6. #6
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Conditional Ranking with large data set

    That is correct. As long as you right click on the pivot table and hit refresh, it should encompass all data.

    Here's the spreadsheet with my formula solution.
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    03-21-2016
    Location
    New York, New York
    MS-Off Ver
    Microsoft Office Professional Plus 2010
    Posts
    8

    Re: Conditional Ranking with large data set

    ah that works! Don't know why it wasn't working originally.

    Thanks!

  8. #8
    Registered User
    Join Date
    03-21-2016
    Location
    New York, New York
    MS-Off Ver
    Microsoft Office Professional Plus 2010
    Posts
    8

    Re: Conditional Ranking with large data set

    Actually - one last question. the ranking is coming in with duplicates (e.g., of two stores had 100K in sales, they're both coming in at rank 9). Is there a way to incorporate a tie brake into the formula?

  9. #9
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Conditional Ranking with large data set

    Sure, what do you want the tie break to be?

  10. #10
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Conditional Ranking with large data set

    PS. There's a way to do almost anything. Often it's just not worth it.

  11. #11
    Registered User
    Join Date
    03-21-2016
    Location
    New York, New York
    MS-Off Ver
    Microsoft Office Professional Plus 2010
    Posts
    8

    Re: Conditional Ranking with large data set

    haha. just tiebrake to the next number. no decimals. Thanks!

  12. #12
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Conditional Ranking with large data set

    In L2 copied down,
    =IF(A2="Australia", SUMPRODUCT(--($A$2:$A$138= "Australia"), --(G2<$G$2:$G$138))+1+COUNTIF($L$1:$L1,SUMPRODUCT(--($A$2:$A$138= "Australia"), --(G2<$G$2:$G$138))+1),"")

    The COUNTIF part I added counts up how many times that rank has appeared before (typically 0) and addis it to the total. So if 11 occurs twice, one is added to the second 11 making it a 12.

  13. #13
    Registered User
    Join Date
    03-21-2016
    Location
    New York, New York
    MS-Off Ver
    Microsoft Office Professional Plus 2010
    Posts
    8

    Re: Conditional Ranking with large data set

    Thanks! but this seems to only work once and then it gets stuck on another repeating number again,

  14. #14
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Conditional Ranking with large data set

    True, it won't do a triple tie.

  15. #15
    Registered User
    Join Date
    03-21-2016
    Location
    New York, New York
    MS-Off Ver
    Microsoft Office Professional Plus 2010
    Posts
    8

    Re: Conditional Ranking with large data set

    is there a way to make it break a triple tie (or multiple ties in general)? tinkering with it now as well

  16. #16
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Conditional Ranking with large data set

    I will play around with it.

  17. #17
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Conditional Ranking with large data set

    I was overthinking it ( I do that a lot). Try this simplier formula

    =IF(A2="Australia", SUMPRODUCT(--($A$2:$A$138= "Australia"), --(G2<$G$2:$G$138))+1+COUNTIF($G$1:$G1,G2),"")

+ 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] Conditional Data Validation Drop-down Lists with Large Amounts of Data
    By Aimee S. in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-27-2015, 01:42 PM
  2. Conditional Drop Down List w/ Large volume of Data
    By Laxb14 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-10-2015, 02:16 AM
  3. Ranking - Non unique Values : Small To Large
    By Jaime1182 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-23-2012, 05:22 PM
  4. Replies: 14
    Last Post: 05-23-2012, 08:09 PM
  5. Conditional Ranking Data with Array Formula
    By memokiller in forum Excel General
    Replies: 2
    Last Post: 03-15-2012, 04:48 PM
  6. Ranking large datasets
    By kwadjo in forum Excel General
    Replies: 2
    Last Post: 03-14-2011, 11:09 AM
  7. [SOLVED] Conditional summing with large amounts of data
    By Revontulet in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-26-2005, 05:06 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