Auto change sum/average range

Noz2k

Well-known Member
Joined
Mar 15, 2011
Messages
693
So basically I haeve a worksheet set up, with 11 columns, and 80 rows.

The 11th column is a 'Total' column. At the moment it either sums or averages the values in the preceding column (dependent upon which row).

However there are currently 4 hidden columns between the 10th and the totals column. There is also a little 'Add' button which unhides the first hidden column.

However when unhidden I want this column to be included in the sum range. However I don't know how to do this, without manually changing it.

For instance

columns A-J are unhidden. K,L,M & N are hidden and O is the 'Totals' column. The formula in O1 = sum(A1:J1). The user clicks 'Add' and column K is unhidden, the sum in O1 should now = sum(A1:K1)
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.

Forum statistics

Threads
1,224,595
Messages
6,179,799
Members
452,943
Latest member
Newbie4296

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