richard1234567891011

Board Regular
Joined
Feb 21, 2018
Messages
91
Hi guys, I need a rank formula, these are the data.

Screenshot-2019-08-09-at-16-59-32.png
[/URL][/IMG]

The expected result is in the green column. So, rank the same values in one (multiple values all equal the same), without jumps of numbers, and consider the different names in another rank (Pescara and Chieti). I need a formula in order to do this.

Thank you guys.
 
This scenario - multiple cities with the same value and different ranks - and adding the possibility of blank cells, requires a complex array formula. Would this be convenient for you? Or would it not be more practical to eliminate blank rows?

Anyway, try this formula ...


A
B
C
D
E
1
City​
Value
Rank​
2
PESCARA​
375
2​
3
PESCARA​
375​
2​
4
PESCARA​
375​
2​
5
6
CHIETI​
375​
3​
7
CHIETI​
375​
3​
8
CHIETI​
375
3​
9
CHIETI​
375
3​
10
CHIETI​
375​
3​
11
CHIETI​
375​
3​
12
CHIETI​
375​
3​
13
14
FARA IN SABINO​
250
4​
15
16
COSSATO​
100
5​
17
18
ALMENO S. SALVATORE​
400
1​
19
ALMENO S. SALVATORE​
400
1​

<tbody>
</tbody>


Array formula in E2 copied down
=IF(A2="","",IF(COUNTIF(A$2:A2,A2)=1,SUM(IF(FREQUENCY(IF(A$2:A$100<>"",MATCH(A$2:A$100,A$2:A$100,0)),ROW(A$2:A$100)-ROW(A$2)+1),IF(B$2:B$100>B2,1)))+1+SUM(IF(FREQUENCY(IF(A$1:A1<>"",MATCH(A$1:A1,A$1:A1,0)),ROW(A$1:A1)-ROW(A$1)+1),IF(A$1:A1<>A2,IF(B$1:B1=B2,1)))),INDEX(E$1:E1,MATCH(A2,A$1:A1,0))))
confirmed with Ctrl+Shift+Enter

M.


There are no blank rows in the middle. The data will be added at the end. The issue with the formula before was related to blank cells at the end.
Anyway. This formula seems a real bomb and it was what I really hoping to find.
I actually have the original file in the working PC and I will able to check it in detail in September.
Anyway, It seems simply perfect!
Thank you very very much. You probably solved a really important thing for the excel that I am building.

Thank you Thank you!!!!!
 
Upvote 0

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
If the cities are grouped and there are no blank rows in the middle, maybe this simpler array formula


A
B
C
D
E
1
City​
Value​
Rank​
2
PESCARA​
375​
2​
3
PESCARA​
375​
2​
4
PESCARA​
375​
2​
5
CHIETI​
375​
3​
6
CHIETI​
375​
3​
7
CHIETI​
375​
3​
8
CHIETI​
375​
3​
9
CHIETI​
375​
3​
10
CHIETI​
375​
3​
11
CHIETI​
375​
3​
12
FARA IN SABINO​
250​
4​
13
COSSATO​
100​
5​
14
ALMENO S. SALVATORE​
400​
1​
15
16

Array formula in E2 copied down
=IF(A2="","",SUM(IF(FREQUENCY(IF(A$2:A$100<>"",MATCH(A$2:A$100,A$2:A$100,0)),ROW(A$2:A$100)-ROW(A$2)+1),IF(B$2:B$100>B2,1)))+1+SUMPRODUCT(--(A$1:A1<>A2),--(B$1:B1=B2),--(MATCH(A$1:A1,A$1:A1,0)=ROW(A$1:A1)-ROW(A$1)+1)))
confirmed with Ctrl+Shift+Enter

M.
 
Upvote 0

Forum statistics

Threads
1,214,978
Messages
6,122,545
Members
449,089
Latest member
davidcom

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