Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
SSHO_99
 
Posts: n/a
Default Modify SUMIF and COUNTIF to work with SUBTOTALS

I use SUMIF and COUNTIF formula's to sum and count data within specific
ranges. Here are the formula's I use to find data from 5.0 to 15.0:

=SUM(N2:N220,-SUMIF(N2:N220,{"<=5.0","=15.0"}))

=COUNTIF(N2:N220,"=5.0")-COUNTIF(N2:N220,"=15.0")

Is there a way to modify these formula's to work with SUBTOTALS?

Thanks,

Steve


  #2   Report Post  
Frank Kabel
 
Posts: n/a
Default

Hi
try something like
=SUMPRODUCT(--(SUBTOTAL(3,OFFSET(INDEX($A$1:$A$10,1,1),ROW($A$1: $A$10)-
ROW(INDEX($A$1:$A$10,1,1)),0))=1),--($A$1:$A$10=5),--($A$1:$A$10<=15))

--
Regards
Frank Kabel
Frankfurt, Germany

"SSHO_99" schrieb im Newsbeitrag
...
I use SUMIF and COUNTIF formula's to sum and count data within

specific
ranges. Here are the formula's I use to find data from 5.0 to 15.0:

=SUM(N2:N220,-SUMIF(N2:N220,{"<=5.0","=15.0"}))

=COUNTIF(N2:N220,"=5.0")-COUNTIF(N2:N220,"=15.0")

Is there a way to modify these formula's to work with SUBTOTALS?

Thanks,

Steve



  #3   Report Post  
Aladin Akyurek
 
Posts: n/a
Default


If you are wanting to combine the formulas you use with AutoFilter,
you'll need the Longre idiom for visible cells...

1.

=SUBTOTAL(9,N2:N220)-SUMPRODUCT(SUBTOTAL(3,OFFSET(N2:N220,ROW(N2:N220)-MIN(ROW(N2:N220)),,1)),--(N2:N220=5),--(N2:N220<=15))

2.

=SUMPRODUCT(SUBTOTAL(3,OFFSET(N2:N220,ROW(N2:N220)-MIN(ROW(N2:N220)),,1)),--(N2:N220=5),--(N2:N220<=15))

SSHO_99 Wrote:
I use SUMIF and COUNTIF formula's to sum and count data within specific
ranges. Here are the formula's I use to find data from 5.0 to 15.0:

=SUM(N2:N220,-SUMIF(N2:N220,{"<=5.0","=15.0"}))

=COUNTIF(N2:N220,"=5.0")-COUNTIF(N2:N220,"=15.0")

Is there a way to modify these formula's to work with SUBTOTALS?

Thanks,

Steve



--
Aladin Akyurek
------------------------------------------------------------------------
Aladin Akyurek's Profile: http://www.excelforum.com/member.php...fo&userid=4165
View this thread: http://www.excelforum.com/showthread...hreadid=277905

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 I create a formula in Excel that will countif or sumif bef. bkclark Excel Worksheet Functions 4 November 10th 04 05:30 PM
Countif, Sumif, If - help! Angel160 Excel Worksheet Functions 2 November 3rd 04 05:23 PM


All times are GMT +1. The time now is 04:38 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"