Ranking data based on criteria - Low to High

JumboCactuar

Well-known Member
Joined
Nov 16, 2016
Messages
788
Office Version
  1. 365
Platform
  1. Windows
Hi,
similar to a question i asked here but now I'm trying to add rankings all the way down the data like below:
how can I add Column D using formula? i think with COUNTIFS but not too sure

Rank 1 = lowest price for item
data is always sorted item, then price low to high

thankyou

Item CodeSellerPriceRank
FR11MapLtd14.991
FR11JustPro15.112
FR11KLG15.193
FR11ABCTech16.494
GR44JustPro35.991
GR44ABCTech36.492
GR44KLG38.993
PG20KLG18.491
PG20MapLtd19.992
PG20ABCTech21.993
PG20JustPro22.794
ZD16ABCTech12.491
ZD16JustPro12.892
ZD16KLG12.993
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
What you're after is what we all want, a function called RANKIF. It does not exist. Unfortunately, function RANK.EQ does not allow filtering in the ref argument.

So here is a well-known work-around. For Item Code, it ranks the Price; the sort order won't matter.

=SUMPRODUCT(--($A$2:$A$15=$A2),--(C2>$C$2:$C$15))+1
 
Upvote 0
Solution
What you're after is what we all want, a function called RANKIF. It does not exist. Unfortunately, function RANK.EQ does not allow filtering in the ref argument.

So here is a well-known work-around. For Item Code, it ranks the Price; the sort order won't matter.

=SUMPRODUCT(--($A$2:$A$15=$A2),--(C2>$C$2:$C$15))+1

thankyou :)
first time ive ever needed to use this
 
Upvote 0
asking this here as its related to formula above

Im trying to set this down a column using VBA using the following:
VBA Code:
    LR = Range("A65000").End(xlUp).Row
    Range("H2:H" & LR).Formula2R1C1 = "=SUMPRODUCT(--(R2C1:R100000C1=RC1),--(RC[-2]>R2C6:R100000C6))+1"
Formula
=SUMPRODUCT(--($A$2:$A$100000=$A2),--(F2>$F$2:$F$100000))+1

and its very slow calculating
does anyone know how to load the data into memory then perform the above, and output to sheet?
 
Upvote 0

Forum statistics

Threads
1,223,908
Messages
6,175,305
Members
452,633
Latest member
DougMo

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top