How to reorder a spreadsheet based on mean of column groups

Poida68

New Member
Joined
Aug 30, 2021
Messages
10
Office Version
  1. 2007
Platform
  1. Windows
Hello,

I have a challenge. And I only have Excel 2002.

I am trying to reorder columns based on the average value associated with a column ID.

I have a spreadsheet with a column of IDs and 3 columns of data.

I want to reorder these values so that the column ID ("group") is in order based on the descending means of the associated values in the "value" column:

Seeking a method or VBA code. Thanks
 

Attachments

  • to be ordered.JPG
    to be ordered.JPG
    122 KB · Views: 7
  • ordered.JPG
    ordered.JPG
    116.4 KB · Views: 7

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
the way I would do that is to use a "helper" column such as column H. put this equation into cell H5 and copy down, then sort on column H
I assume your data ended at row 30 adjust a necessary
Excel Formula:
=AVERAGEIF(D$5:D$30,D5,B$5:B$30)
 
Upvote 0
Solution
I just checked excel 2002 doesn't have averageif, so you will need to use Sumif divided by countif in column H
 
Upvote 0

Forum statistics

Threads
1,214,965
Messages
6,122,495
Members
449,088
Latest member
Melvetica

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