Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 31
Default Subtoal excluding hidden columns

Does anyone how I can sum many columns within a row but exclude hidden colums
from the calculation?
The subtotal(109,"range") works for rows but not columns

Thank you!

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 791
Default Subtoal excluding hidden columns

The SUBTOTAL function is designed for columns of data, or vertical ranges. It
is not designed for rows of data, or horizontal ranges. For example, when you
subtotal a horizontal range using a function_num of 101 or greater, such as
SUBTOTAL(109,B2:G2), hiding a column does not affect the subtotal. But,
hiding a row in a subtotal of a vertical range does affect the subtotal.
--
If this posting was helpful, please click on the Yes button.
Regards,

Michael Arch.




"Trevor" wrote:

Does anyone how I can sum many columns within a row but exclude hidden colums
from the calculation?
The subtotal(109,"range") works for rows but not columns

Thank you!

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 964
Default Subtoal excluding hidden columns

You would need a vba solution, subtotal when it comes to hidden columns does
not work,
only rows will work. Also note that it won't work with hidden rows in
previous versions
to 2003.

--


Regards,


Peo Sjoblom

"Trevor" wrote in message
...
Does anyone how I can sum many columns within a row but exclude hidden
colums
from the calculation?
The subtotal(109,"range") works for rows but not columns

Thank you!



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 144
Default Subtoal excluding hidden columns

I have tried the Subtotal function with a hidden column
and it work for me.

check the column headings which you want to apply subtotals to
under Add subtotal to in the Subtotal dialog box

Is this waht you are after?
Pls click Yes if this help

cheers

"Trevor" wrote:

Does anyone how I can sum many columns within a row but exclude hidden colums
from the calculation?
The subtotal(109,"range") works for rows but not columns

Thank you!

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,718
Default Subtoal excluding hidden columns

=SUM(A1,C1,F1,H1)

adjust to suit


"Trevor" wrote:

Does anyone how I can sum many columns within a row but exclude hidden colums
from the calculation?
The subtotal(109,"range") works for rows but not columns

Thank you!



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 144
Default Subtoal excluding hidden columns

If you are looking to sum across the columns, the only solution I know of is
a macro, try this UDF:

Function SUMVIS(rng)
Dim CellSum As Long
Dim Cell As Range
Application.Volatile
CellSum = 0
Set rng = Intersect(rng.Parent.UsedRange, rng)
For Each Cell In rng
If IsNumeric(Cell) Then
If Not Cell.EntireRow.Hidden And _
Not Cell.EntireColumn.Hidden Then _
CellSum = CellSum + Cell
End If
Next Cell
SUMVIS = CellSum
End Function

Enter : =SUMVIS(..your columns...)


Does this do what you want?
Pls click Yes if this have help you.

cheers,

"xlmate" wrote:

I have tried the Subtotal function with a hidden column
and it work for me.

check the column headings which you want to apply subtotals to
under Add subtotal to in the Subtotal dialog box

Is this waht you are after?
Pls click Yes if this help

cheers

"Trevor" wrote:

Does anyone how I can sum many columns within a row but exclude hidden colums
from the calculation?
The subtotal(109,"range") works for rows but not columns

Thank you!

  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 24
Default Subtoal excluding hidden columns

On Nov 25, 8:55*am, Trevor wrote:
Does anyone how I can sum many columns within a row but exclude hidden colums
from the calculation?
*The subtotal(109,"range") works for rows but not columns

Thank you!


Here's a sum and a count function. Hope it helps. Chris M.

Function Sum_Visible_Cells(Cells_To_Sum As Object)
Application.Volatile
For Each cell In Cells_To_Sum
If cell.Rows.Hidden = False Then
If cell.Columns.Hidden = False Then
total = total + cell.Value
End If
End If
Next
Sum_Visible_Cells = total
End Function

Function Count_Visible_Cells(Cells_To_Count As Object)
Application.Volatile
For Each cell In Cells_To_Count
If cell.Rows.Hidden = False Then
If cell.Columns.Hidden = False Then
rowcnt = rowcnt + 1
End If
End If
Next
Count_Visible_Cells = rowcnt
End Function
  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,346
Default Subtoal excluding hidden columns

Very cute!

Shaen

"Teethless mama" wrote:

=SUM(A1,C1,F1,H1)

adjust to suit


"Trevor" wrote:

Does anyone how I can sum many columns within a row but exclude hidden colums
from the calculation?
The subtotal(109,"range") works for rows but not columns

Thank you!

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Countif excluding hidden rows qh8519a Excel Worksheet Functions 4 September 19th 08 06:22 PM
Excluding formulas in hidden cells? Adam L. Kehl Excel Worksheet Functions 3 April 10th 08 03:35 PM
Sum of a column excluding hidden rows mnwild1 Excel Worksheet Functions 10 June 22nd 07 11:24 PM
Need to sum columns, excluding hidden columns. psill Excel Discussion (Misc queries) 7 October 13th 06 07:49 PM
Need to sum columns, excluding hidden ones - like 'subtotal' for r psill Excel Discussion (Misc queries) 0 October 12th 06 08:14 PM


All times are GMT +1. The time now is 03:14 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"