+ Reply to Thread
Results 1 to 14 of 14

Rank formula based on condition

  1. #1
    Registered User
    Join Date
    10-13-2013
    Location
    Sydney
    MS-Off Ver
    Excel 2013
    Posts
    52

    Rank formula based on condition

    Hi all gurus,

    trying to get a rank formula in the attached. The rank formula should be based on same store number in column D and should only rank those sales $ for that store. Any advice?

    Ta
    Attached Files Attached Files

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,382

    Re: Rank formula based on condition

    I got my crystal ball out, but even it couldn't read the attachment - did you use invisible type???

    I'm thinking along the lines of RANK and IF combined, but could do with seeing the data.
    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. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    10-13-2013
    Location
    Sydney
    MS-Off Ver
    Excel 2013
    Posts
    52

    Re: Rank formula based on condition

    Oops. sorry.

    now with the visible data.

    S
    Attached Files Attached Files

  4. #4
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Microsoft® Excel® for Microsoft 365 MSO (Version 2503 Build 16.0.18604.20000) 64-bit
    Posts
    3,992

    Re: Rank formula based on condition

    Try

    F3=1+SUMPRODUCT(($D$3:$D$6=D3)*($E$3:$E$6>E3)) and drag down!!!
    If I helped, Don't forget to add reputation (click on the little star ★ at bottom of this post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)

  5. #5
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Rank formula based on condition

    Try this...

    Entered in F3 and copied down:

    =SUMPRODUCT(--(D$3:D$6=D3),--(E3<E$3:E$6))+1
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  6. #6
    Registered User
    Join Date
    10-13-2013
    Location
    Sydney
    MS-Off Ver
    Excel 2013
    Posts
    52

    Re: Rank formula based on condition

    Thanks guys. if there is one more condition to this, is there a quick formula to run? In column F, each store has "Include" & "Exclude" as a flag. I only want to rank if the flag is "Include"

    Desired outcome in column G.

    Thank you.
    Attached Files Attached Files

  7. #7
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Rank formula based on condition

    Like this...

    =IF(F3="Exclude","",SUMPRODUCT(--(D$3:D$17=D3),--(E3<E$3:E$17),--(F$3:F$17="Include"))+1)

  8. #8
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Microsoft® Excel® for Microsoft 365 MSO (Version 2503 Build 16.0.18604.20000) 64-bit
    Posts
    3,992

    Re: Rank formula based on condition

    or

    =IF(F4="Exclude","",1+SUMPRODUCT(($D$3:$D$17&$F$3:$F$17=$D4&$F4)*($E$3:$E$17>$E4)))

  9. #9
    Registered User
    Join Date
    10-13-2013
    Location
    Sydney
    MS-Off Ver
    Excel 2013
    Posts
    52

    Re: Rank formula based on condition

    THanks guys, what if the sales column is in % (not $).

  10. #10
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2024
    Posts
    6,175

    Re: Rank formula based on condition

    Or try this ...

    =IF(F3="Exclude","",COUNTIFS(D$3:D$17,D3,E$3:E$17,">"&E3,F$3:F$17,"Include")+1)

  11. #11
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Microsoft® Excel® for Microsoft 365 MSO (Version 2503 Build 16.0.18604.20000) 64-bit
    Posts
    3,992

    Re: Rank formula based on condition

    Quote Originally Posted by shrijan View Post
    THanks guys, what if the sales column is in % (not $).
    It will work whatever you have in numerical value, I think

    Mr. Biff Can you confirm us it can work or misbehave??

  12. #12
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Rank formula based on condition

    Quote Originally Posted by shukla.ankur281190 View Post
    It will work whatever you have in numerical value, I think
    Yes, it should work on any numeric value.

  13. #13
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Microsoft® Excel® for Microsoft 365 MSO (Version 2503 Build 16.0.18604.20000) 64-bit
    Posts
    3,992

    Re: Rank formula based on condition

    Quote Originally Posted by Tony Valko View Post
    Yes, it should work on any numeric value.
    Thanks Mr. Biff

  14. #14
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Rank formula based on condition




    -------------

+ 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: 04-27-2015, 08:50 AM
  2. Formula to rank based on average?
    By mrbusto71 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-28-2014, 06:35 PM
  3. Replies: 2
    Last Post: 09-04-2014, 02:08 PM
  4. Rank formula based on a exclusion criteria.
    By Jabba69 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-08-2014, 08:39 AM
  5. I need a formula that will rank based on highest data
    By agorman83 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-13-2014, 08:50 AM
  6. [SOLVED] A formula to rank the Top 10 products based on month selection
    By Aland2929 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-21-2013, 12:54 PM
  7. Replies: 1
    Last Post: 08-15-2005, 05:05 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