Sum up visible rows of column

User avatar
adam
SilverLounger
Posts: 2347
Joined: 23 Feb 2010, 12:07

Sum up visible rows of column

Post by adam »

Hi,

The following formula sum ups all rows of column P=SUM(P:P) when placed in A1. How could it be made to sum up all the visible rows when placed in cell A1?

Any help on this would be kindly appreciated.
Best Regards,
Adam

User avatar
HansV
Administrator
Posts: 78545
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Sum up visible rows of column

Post by HansV »

Are the rows hidden by a filter or by other means?
Best wishes,
Hans

User avatar
rory
5StarLounger
Posts: 817
Joined: 24 Jan 2010, 15:56

Re: Sum up visible rows of column

Post by rory »

If using 2003 or later:
=SUBTOTAL(109,P:P)
Regards,
Rory

User avatar
adam
SilverLounger
Posts: 2347
Joined: 23 Feb 2010, 12:07

Re: Sum up visible rows of column

Post by adam »

Thanks for the reply Hans. Yes, the rows are hidden by a filter. And thanks for the formula Rory. your formula works fine.
Best Regards,
Adam

User avatar
HansV
Administrator
Posts: 78545
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Sum up visible rows of column

Post by HansV »

Rory's formula works whether the rows are hidden by a filter or otherwise.

To ignore rows hidden by a filter, you can also use

=SUBTOTAL(9,P:P)
Best wishes,
Hans

User avatar
adam
SilverLounger
Posts: 2347
Joined: 23 Feb 2010, 12:07

Re: Sum up visible rows of column

Post by adam »

The formula sum ups the column from row 1 and so on. How could it be made to sum up starting from row 17?
Best Regards,
Adam

User avatar
HansV
Administrator
Posts: 78545
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Sum up visible rows of column

Post by HansV »

=SUBTOTAL(9,P17:P1000)

Adjust the 1000 to a number larger than the number of rows you expect to use.
Best wishes,
Hans