Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
bucketheaduk
 
Posts: n/a
Default Sum function which ignores hidden rows


Hey

I'm looking for a way to sum rows but ignore the adjacent rows which
are hidden. excel is adding the stuff in the unhide rows (which is
what i want) but also adding the hidden row numbers too (which i don't
want).

cheers for the help.


--
bucketheaduk
------------------------------------------------------------------------
bucketheaduk's Profile: http://www.excelforum.com/member.php...o&userid=28032
View this thread: http://www.excelforum.com/showthread...hreadid=475352

  #2   Report Post  
Ron Rosenfeld
 
Posts: n/a
Default

On Wed, 12 Oct 2005 06:02:39 -0500, bucketheaduk
wrote:


Hey

I'm looking for a way to sum rows but ignore the adjacent rows which
are hidden. excel is adding the stuff in the unhide rows (which is
what i want) but also adding the hidden row numbers too (which i don't
want).

cheers for the help.


If the rows are hidden as a result of the list being filtered, you could use
the SUBTOTAL(9,rng) function.

If the rows ae hidden by some other method, then you can use a UDF (user
defined function) written in VBA.

This is from support.microsoft.com
====================
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
========================

To enter this, <alt<F11 opens the VB Editor. Ensure your project is
highlighted in the Project Explorer window, then Insert/Module and paste the
code into the window that opens.

Return to your worksheet and enter the formula:

=Sum_Visible_cells(cell_ref) into some cell.



--ron
  #3   Report Post  
Bob Phillips
 
Posts: n/a
Default

Look at the =SUBTOTAL() function
In XL 2002 and before, it only ignores rows hidden by a filter, but XL 2003
gives the option to ignore manually hidden rows.


--
HTH

Bob Phillips

"bucketheaduk"
wrote in message
news:bucketheaduk.1wsd6f_1129115114.5725@excelforu m-nospam.com...

Hey

I'm looking for a way to sum rows but ignore the adjacent rows which
are hidden. excel is adding the stuff in the unhide rows (which is
what i want) but also adding the hidden row numbers too (which i don't
want).

cheers for the help.


--
bucketheaduk
------------------------------------------------------------------------
bucketheaduk's Profile:

http://www.excelforum.com/member.php...o&userid=28032
View this thread: http://www.excelforum.com/showthread...hreadid=475352



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
How do you ignore hidden rows in a SUMIF() function? Gerry Excel Worksheet Functions 12 October 8th 09 05:20 PM
Summing only those cells that aren't hidden JodyK Excel Worksheet Functions 5 September 13th 05 06:35 PM
How to display hidden rows maybe defined by scenario JCereda Excel Worksheet Functions 0 June 30th 05 04:01 PM
using SUBTOTAL() on rows that have been hidden doco Excel Worksheet Functions 2 June 7th 05 07:18 PM
hidden rows & columns slow file open Simon Shaw Excel Discussion (Misc queries) 0 April 5th 05 12:21 AM


All times are GMT +1. The time now is 05:55 AM.

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

About Us

"It's about Microsoft Excel"