One Ranking for Multiple Ranges

AboveBeyond

Board Regular
Joined
Aug 14, 2007
Messages
114
Example:

1. 50
2. 75
3. 35
4. =sum(A1:A3)
5. 22
6. 99
7. 48
8. =sum(A5:A7)


It would rank rows 1-3 and 5-7 and not rows 4&8 because I don't want the sums ranked.

Thanks! :biggrin:
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.

Domenic

MrExcel MVP
Joined
Mar 10, 2004
Messages
20,916
Office Version
  1. 365
Platform
  1. Windows
If the format is consistent, that is, 3 rows of numbers and a sum, try the following...

B1, copied down:

=IF(MOD(ROW()-ROW($A$1),4)+1<4,SUM(IF(MOD(ROW($A$1:$A$8)-ROW($A$1),4)+1<4,IF(A1<$A$1:$A$8,1)))+1,"")

...confirmed with CONTROL+SHIFT+ENTER

If the format is not consistent, replace...

=SUM(A1:A3)

and

=SUM(A5:A7)

with

=SUBTOTAL(9,A1:A3)

and

=SUBTOTAL(9,A5:A7)

...and try the following instead...

B1, copied down:

=IF(SUBTOTAL(3,A1),SUM(IF(SUBTOTAL(3,OFFSET($A$1:$A$8,ROW($A$1:$A$8)-ROW($A$1),0,1)),IF(A1<$A$1:$A$8,1)))+1,"")

...confirmed with CONTROL+SHIFT+ENTER

Note that both formulas will rank from highest to lowest, and will return the following result...

50 3
75 2
35 5
160
22 6
99 1
48 4
169

Hope this helps!
 
Upvote 0

Forum statistics

Threads
1,191,501
Messages
5,986,927
Members
440,067
Latest member
Swatts1

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
Top