Excel 2016 Total or Subtotal Row ignoring hidden columns

Chris Waller

Board Regular
Joined
Jan 18, 2009
Messages
183
Office Version
  1. 365
Platform
  1. Windows
Hi all,

I am trying to create a subtotal across a row like you would down a column, however, when you try to subtotal a row the calculation appears to include the hidden information.

I have a Spreadsheet that contains numerous macros which hide\unhide columns of data, however, when I try to create a total or subtotal of the rows of data the hidden data are always included in the total, unlike when you are subtotalling a column of data when it only totals the visible figures.

Does anyone know if you can use a formula to do this kind of calculation or would it be better to do this using VBA? If so, could someone please let me know how I should go about this? TIA
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
Hi
Whilst Hiding or Unhiding your columns, could you get your macro to put a letter "H" for example in row 1?
Then you could use something like
=SUMIFS(C3:S3,$C$1:$S$1,"<>H")
 
Upvote 0
Thanks for the formula above. I have just tried it and unfortunately it doesn't appear to work.
It wasn't a stand-alone formula suggestion. It also included ..
Whilst Hiding or Unhiding your columns, could you get your macro to put a letter "H" for example in row 1?
Did you alter your macro to do something like that? (You may need to insert a new row and hide it to preserve the look of your sheet)
 
Upvote 0

Forum statistics

Threads
1,224,818
Messages
6,181,152
Members
453,021
Latest member
Justyna P

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