Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default How to add only the adding filtered result using SUM function?

Hello,

I have a column with some numbers and they're added up at the bottom
of the column with the SUM function. Now when I use a filter on
another column, some rows become hidden, but the sum does not change.
In this case, I'd like to just add those visible rows.

Thanks for your help!
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 896
Default How to add only the adding filtered result using SUM function?

use SUBTOTAL function
you might read about it in Help


On 27 Maj, 08:38, Kelie wrote:
Hello,

I have a column with some numbers and they're added up at the bottom
of the column with the SUM function. Now when I use a filter on
another column, some rows become hidden, but the sum does not change.
In this case, I'd like to just add those visible rows.

Thanks for your help!


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4
Default How to add only the adding filtered result using SUM function?

On May 26, 8:49*pm, Jarek Kujawa wrote:
use SUBTOTAL function
you might read about it in Help


Jarek,

Thank you. That almost did exactly what I want. I should have
mentioned there are some negative numbers that I don't want to
include. So I was using the SUMIF function like this: SUMIF((E2:E22),
"0"). I guess SUBTOTALIF is not a valid function. Is it still
possible?
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 896
Default How to add only the adding filtered result using SUM function?

don't know if its doable with SUBTOTAL

you might use however this function

Function sum_plus(rng As Range) As Double
Dim cell As Range

For Each cell In rng.Cells
If Not cell.Rows.EntireRow.Hidden And cell.Value 0 Then
sum_plus = sum_plus + cell.Value
End If
Next cell

End Function

press ALT+F11 to get to VBA window, then Insert-Module and paste this
code there

go back to your worksheet and insert
=sum_plus(your_range)
to calculate

pls click YES if it helped

On 27 Maj, 09:40, Kelie wrote:
On May 26, 8:49*pm, Jarek Kujawa wrote:

use SUBTOTAL function
you might read about it in Help


Jarek,

Thank you. That almost did exactly what I want. I should have
mentioned there are some negative numbers that I don't want to
include. So I was using the SUMIF function like this: SUMIF((E2:E22),
"0"). I guess SUBTOTALIF is not a valid function. Is it still
possible?


  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,766
Default How to add only the adding filtered result using SUM function?

Hi,

Assume the range is in F9:F13 (excluding the header row). Try this formula

=SUMPRODUCT(SUBTOTAL(9,OFFSET(F9:F13,ROW(F9:F13)-ROW(F9),,1))*(F9:F130))

--
Regards,

Ashish Mathur
Microsoft Excel MVP
www.ashishmathur.com

"Kelie" wrote in message
...
Hello,

I have a column with some numbers and they're added up at the bottom
of the column with the SUM function. Now when I use a filter on
another column, some rows become hidden, but the sum does not change.
In this case, I'd like to just add those visible rows.

Thanks for your help!




  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default How to add only the adding filtered result using SUM function?

Jarek, Ashish:

Both methods work well. Thanks for your help!
  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,766
Default How to add only the adding filtered result using SUM function?

You are welcome

--
Regards,

Ashish Mathur
Microsoft Excel MVP
www.ashishmathur.com

"Kelie" wrote in message
...
Jarek, Ashish:

Both methods work well. Thanks for your help!


  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 896
Default How to add only the adding filtered result using SUM function?

thanks for the feedback

pls click YES if it helped

On 29 Maj, 10:03, Kelie wrote:
Jarek, Ashish:

Both methods work well. Thanks for your help!


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
Adding a sequence to filtered data [email protected] Excel Discussion (Misc queries) 2 December 7th 07 07:04 PM
I want to add up the result of a filtered list Scott Excel Worksheet Functions 1 March 11th 07 11:45 AM
HOW TO GET A DESIRED 'SUMIF' RESULT FROM A FILTERED DATA ABDUL RAHMAN Excel Worksheet Functions 1 August 2nd 06 03:05 PM
Adding only the filtered results spartikus411 Excel Worksheet Functions 1 May 31st 06 10:58 AM
Adding text to the result of a formula? Robbie in Houston Excel Worksheet Functions 2 February 28th 05 12:00 AM


All times are GMT +1. The time now is 02:00 PM.

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"