sum values in a column only for unhidden rows?

  • Thread starter Thread starter lindasf
  • Start date Start date
L

lindasf

If I have a list of rows (some of which are hidden) is there a way t
sum values in a column and IGNORE the values in the hidden rows - e.g
only sum the values in that column for rows that are NOT hidden.

Thx.

lindas
 
Hi

i use a "user defined function" - copy & paste this into a module sheet in
your excel workbook (or personal.xls)

Function sumvisible(r1 As Range)
sumvisible = 0
On Error Resume Next
For Each c In r1
If c.EntireRow.Hidden <> True Then
sumvisible = sumvisible + c.Value
End If
Next
End Function

then click in the cell where you want the answer
choose your paste function wizard (fx icon) - from the categories choose
User Defined
click on the sumvisible function, specify the range to sum and you'll get
the total of the visible cells only.

Cheers
JulieD
 
Hi
if you have hidden the rows using Filters try
=SUBTOTAL(9,A1:A100)

if you have Excel 2003 you could also use SUBTOTAL for manually hidden
rows. Try
=SUBTOTAL(109,A1:A100)
 
See one more reply at your first post.

lindasf < said:
If I have a list of rows (some of which are hidden) is there a way to
sum values in a column and IGNORE the values in the hidden rows - e.g.
only sum the values in that column for rows that are NOT hidden.

Thx.

lindasf
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top