subtotal median

oscarbei

New Member
Joined
Sep 13, 2012
Messages
1
we've got a excel sheet populated with column ROA and firm year, there's over 10000+rows of data and we have already sorted the data according to the firm year but now we want to get the median ROA for each year. and the subtotal function only have ave, is there a way aotomatically group the same year data and give us the ROA median.
Thanks
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
we've got a excel sheet populated with column ROA and firm year, there's over 10000+rows of data and we have already sorted the data according to the firm year but now we want to get the median ROA for each year. and the subtotal function only have ave, is there a way aotomatically group the same year data and give us the ROA median.
Thanks
See if this helps...

This array formula will return the median of the filtered (or unfiltered) range. The full range is C4:C20.

=MEDIAN(IF(SUBTOTAL(2,OFFSET(C4,ROW(C4:C20)-ROW(C4),0)),C4:C20))

** array formulas need to be entered using the key
combination of CTRL,SHIFT,ENTER (not just ENTER).
Hold down both the CTRL key and the SHIFT key
then hit ENTER.
 
Upvote 0

Forum statistics

Threads
1,223,958
Messages
6,175,632
Members
452,661
Latest member
Nonhle

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