Indexing from largest to smallest

Dougmclain

New Member
Joined
Aug 18, 2014
Messages
6
[TABLE="width: 700"]
<tbody>[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][TABLE="width: 500, align: right"]
<tbody>[TR]
[TD][/TD]
[TD][/TD]
[TD]Table 1[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Interest[/TD]
[TD]Clubhouse[/TD]
[TD]Dividend[/TD]
[TD]Rental[/TD]
[TD]Parking[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]5[/TD]
[TD]100[/TD]
[TD]20[/TD]
[TD]0[/TD]
[TD]5[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD][/TD]
[TD]Table 2[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]Clubhouse[/TD]
[TD]100[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]Dividend[/TD]
[TD]20[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]Interest[/TD]
[TD]5[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD]Parking[/TD]
[TD]5[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]8[/TD]
[TD][/TD]
[TD]130[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]

I am trying to create table 2 in descending order based on the row data in table 1. I only want a row in table 2 with a description to show up if the number is greater than zero and then total the numbers. I used =large(A2:E2,1) for cell B4, and =large(A2:E2,2) for cell B5. I can't figure out how to get the description cell above to show up in Table 2 in the correct order. I also don't know how to exclude a row if the value of a cell is zero, and then to put the total in the correct cell.

Thanks,
 
I have to have the total be below the last number, I can have the total show up in A5 but I still need to have it show up on the line below the last number such as in B11.

Thanks,

If you insist...

[Table="width:, class:grid"][tr][td]Row\Col[/td][td]
A​
[/td][td]
B​
[/td][td]
C​
[/td][td]
D​
[/td][td]
E​
[/td][td]
F​
[/td][/tr]
[tr][td]
1​
[/td][td] Interest[/td][td] Clubhouse[/td][td] Dividend[/td][td] ISP[/td][td] Rental[/td][td] Parking[/td][/tr]


[tr][td]
2​
[/td][td] 5[/td][td] 100[/td][td] 20[/td][td] 20[/td][td] 0[/td][td] 5[/td][/tr]


[tr][td]
3​
[/td][td] [/td][td] [/td][td] [/td][td] [/td][td] [/td][td] [/td][/tr]


[tr][td]
4​
[/td][td] 5[/td][td][/td][td] [/td][td] [/td][td] [/td][td] [/td][/tr]


[tr][td]
5​
[/td][td] [/td][td] [/td][td] [/td][td] [/td][td] [/td][td] [/td][/tr]


[tr][td]
6​
[/td][td] Clubhouse[/td][td] 100[/td][td] [/td][td] [/td][td] [/td][td] [/td][/tr]


[tr][td]
7​
[/td][td] Dividend[/td][td] 20[/td][td] [/td][td] [/td][td] [/td][td] [/td][/tr]


[tr][td]
8​
[/td][td] ISP[/td][td] 20[/td][td][/td][td][/td][td][/td][td][/td][/tr]


[tr][td]
9​
[/td][td] Interest[/td][td] 5[/td][td][/td][td][/td][td][/td][td][/td][/tr]


[tr][td]
10​
[/td][td] Parking[/td][td] 5[/td][td][/td][td][/td][td][/td][td][/td][/tr]


[tr][td]
11​
[/td][td] [/td][td] 150[/td][td][/td][td][/td][td][/td][td][/td][/tr]


[tr][td]
12​
[/td][td] [/td][td] [/td][td][/td][td][/td][td][/td][td][/td][/tr]
[/table]


In A4 just enter:
Rich (BB code):
=COUNTIFS(A2:F2,">0")

This formula is the same as the original.

In A6 control+shift+enter and copy down:
Rich (BB code):
=IFERROR(IF($B6="","",INDEX($A$1:$F$1,SMALL(IF(ISNUMBER(1/$A$2:$F$2),
    IF($A$2:$F$2=$B6,COLUMN($A$1:$F$1)-COLUMN($A$1)+1)),COUNTIFS($B$6:B6,B6)))),"")

This extends the original.

In B6 control+shift+enter and copy down:
Rich (BB code):
=IF(ROWS($B$6:B6)<=$A$4,LARGE(IF(ISNUMBER(1/$A$2:$F$2),$A$2:$F$2),
    ROWS($B$6:B6)),IF(ROWS($B$6:B6)=$A$4+1,SUM(OFFSET($B6,-1,0,-$A$4)),""))

This also extends the original.
 
Upvote 0

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.

Forum statistics

Threads
1,223,229
Messages
6,170,881
Members
452,364
Latest member
springate

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