Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default conditional subtotal function


i can't seem to get anything to work.

the data appears as follows:


Code:
--------------------

A B
ON 1000
ON 1000
OFF 500
OFF 500
ON 1000
OFF 1000
OFF 400
OFF 300
ON 400

--------------------


now, i have an autofilter that will filter some of these out and leave
the rest, e.g.:


Code:
--------------------

A B
OFF 500
OFF 500
ON 1000
OFF 1000
ON 400

--------------------


now i need to calculate a sum with the condition that the value in
column a is "on". here, the answer should be 1400.

the usual array formula with a sum doesn't work because it sums hidden
cells as well. the only function i know of that sums correctly is the
subtotal function, but i don't know how to add the "on"-only condition
to it.

any ideas? thanks.


--
dreamz
------------------------------------------------------------------------
dreamz's Profile: http://www.excelforum.com/member.php...o&userid=26462
View this thread: http://www.excelforum.com/showthread...hreadid=572446

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default conditional subtotal function


http://www.contextures.com/xlFunctions01.html

Check this page for info to sum a filtered list


--
davesexcel


------------------------------------------------------------------------
davesexcel's Profile: http://www.excelforum.com/member.php...o&userid=31708
View this thread: http://www.excelforum.com/showthread...hreadid=572446

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,593
Default conditional subtotal function

=SUMPRODUCT((SUBTOTAL(9,OFFSET($B$1,ROW($B$2:$B$20 )-ROW($B$1),,1)))*(A2:A20=
"ON"))

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"dreamz" wrote in
message ...

i can't seem to get anything to work.

the data appears as follows:


Code:
--------------------

A B
ON 1000
ON 1000
OFF 500
OFF 500
ON 1000
OFF 1000
OFF 400
OFF 300
ON 400

--------------------


now, i have an autofilter that will filter some of these out and leave
the rest, e.g.:


Code:
--------------------

A B
OFF 500
OFF 500
ON 1000
OFF 1000
ON 400

--------------------


now i need to calculate a sum with the condition that the value in
column a is "on". here, the answer should be 1400.

the usual array formula with a sum doesn't work because it sums hidden
cells as well. the only function i know of that sums correctly is the
subtotal function, but i don't know how to add the "on"-only condition
to it.

any ideas? thanks.


--
dreamz
------------------------------------------------------------------------
dreamz's Profile:

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



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default conditional subtotal function


thanks, dave! i'll be reading through that site to better understand the
functions.

bob, that worked perfectly. now to figure out exactly what it means.
thanks again.


--
dreamz
------------------------------------------------------------------------
dreamz's Profile: http://www.excelforum.com/member.php...o&userid=26462
View this thread: http://www.excelforum.com/showthread...hreadid=572446

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
Help on a function with Conditional Formatting nemadrias Excel Worksheet Functions 1 August 10th 06 08:55 PM
Protection using the subtotal function Scottm Excel Worksheet Functions 1 July 21st 06 05:38 PM
Conditional Formatting (IF function) Neo1 Excel Worksheet Functions 5 March 2nd 06 10:38 PM
Conditional Function Application [email protected] Excel Discussion (Misc queries) 3 February 26th 06 05:05 AM
subtotal - pivot table - or better function klafert Excel Worksheet Functions 0 June 16th 05 06:12 AM


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

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"