Rankif

sobrien1234

Board Regular
Joined
May 10, 2016
Messages
175
Office Version
  1. 365
Platform
  1. Windows
Is it possible to do a rankif formula similar to an averageif?
The average if formula would be = averageif(A$1:A$100,b1,c$1:c$1000) and so on so I could copy it down column D
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
You can use countifs to rank with a <B1 or >B1 criteria depending on which way you want to rank.
 
Upvote 0
Could you post a small set of sample data and the expected results with XL2BB?
 
Upvote 0
Example.xlsx
E
7
Sheet1


So the answer in column C ranks the times in column B but only for the same code in column A - hope that makes sense? need a formula for column C that I can copy down as have thousands of rows of data
 
Upvote 0
You need to select the range that you want displayed before clicking 'Capture Range'
 
Upvote 0
Sorry first time - try this:
Example.xlsx
ABC
1CodeTimeAnswer
2WAN43978918.123
3WAN43978918.041
4WAN43978918.427
5WAN43978918.468
6WAN43978918.264
7WAN43978918.112
8WAN43978918.326
9WAN43978918.305
10WAN439781031.736
11WAN439781031.555
12WAN439781031.224
13WAN439781031.082
14WAN439781031.021
15WAN439781031.123
16WAN439781032.577
17WAN439781032.728
18WAN439781117.901
19WAN439781118.185
20WAN439781118.448
21WAN439781118.357
22WAN439781118.102
23WAN439781118.164
24WAN439781118.326
25WAN439781118.153
Sheet1
Cell Formulas
RangeFormula
C2:C9C2=RANK(B2,B$2:B$9,1)
C10:C17C10=RANK(B10,B$10:B$17,1)
C18:C25C18=RANK(B18,B$18:B$25,1)
 
Upvote 0
As I pointed out earlier
You can use countifs to rank with a <B1 or >B1 criteria depending on which way you want to rank.
This will give the same results as the RANK formulas in your example

=1+COUNTIFS($A$2:$A$1000,A2,$B$2:$B$1000,"<"&B2)
 
Upvote 0
SUMPRODUCT is also an option

20 05 27.xlsm
ABC
1CodeTimeAnswer
2WAN43978918.123
3WAN43978918.041
4WAN43978918.427
5WAN43978918.468
6WAN43978918.264
7WAN43978918.112
8WAN43978918.326
9WAN43978918.35
10WAN439781031.736
11WAN439781031.555
12WAN439781031.224
13WAN439781031.082
14WAN439781031.021
15WAN439781031.123
16WAN439781032.577
17WAN439781032.728
18WAN439781117.91
19WAN439781118.185
20WAN439781118.448
21WAN439781118.357
22WAN439781118.12
23WAN439781118.164
24WAN439781118.326
25WAN439781118.153
Rank in groups
Cell Formulas
RangeFormula
C2:C25C2=SUMPRODUCT(($A$2:$A$1000=A2)*(B2>$B$2:$B$1000))+1
 
Upvote 0

Forum statistics

Threads
1,214,383
Messages
6,119,196
Members
448,874
Latest member
Lancelots

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