ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   top values within subtotals (https://www.excelbanter.com/excel-programming/387863-top-values-within-subtotals.html)

chrisase

top values within subtotals
 
I have a worksheet where i've used subtotals to separate out data into
subsets. within those subsets I want to indicate which rows have the highest
and second highest value in a given column. There are something like 100
groups, so doing it one subset at a time is not good. Any suggestions?

DownThePaint

top values within subtotals
 
Hi chrisase;

One way might be to not use the build in subtotals and do it
programatically. Sort the results so the data lines up by category then loop
down the numeric column incrementing the total value for the sub set. Hold
variables as you do it for varTopValue & varSecond Value and maybe their
address. Then when the sub totaling rotine completes you can go back to the
address and highlight the top two rows.

Hope it helps,
--
DownThePaint
Where points are scored and games are won!


"chrisase" wrote:

I have a worksheet where i've used subtotals to separate out data into
subsets. within those subsets I want to indicate which rows have the highest
and second highest value in a given column. There are something like 100
groups, so doing it one subset at a time is not good. Any suggestions?



All times are GMT +1. The time now is 11:00 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com