Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Subtotal function with Criteria

Hi

Has anyone created a macro that uses the functionality of the SUBTOTAL with
the functionality of the SUMIF.

I am trying to sum only visible cells using a selection criteria.

Thanks in Advance


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Subtotal function with Criteria

Hi
try the following:
=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="lookup_value"),$B$1:$B
$10)

looks for the value 'lookup_value' in column A and sums the
corresponding value in column B


--
Regards
Frank Kabel
Frankfurt, Germany


Dilip Mistry wrote:
Hi

Has anyone created a macro that uses the functionality of the
SUBTOTAL with the functionality of the SUMIF.

I am trying to sum only visible cells using a selection criteria.

Thanks in Advance


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Subtotal function with Criteria


Invoking the Longre idiom...

=SUMPRODUCT(SUBTOTAL(9,OFFSET(C$4:C$30,ROW(C$4:C$3 0)-MIN(ROW(C$4:C$30)),,1)),--($B$4:$B$30=$A2))

where C4:C30 is the range to sum and B4:B10 the range for which A2 (th
condition) must hold.

Note. 9 instead of 3 in the SUBTOTAL(...) bit is due (in a post a
MrExcel) to Domenic.

Dilip Mistry Wrote:
Hi

Has anyone created a macro that uses the functionality of the SUBTOTA
with
the functionality of the SUMIF.

I am trying to sum only visible cells using a selection criteria.

Thanks in Advanc


--
Aladin Akyure
-----------------------------------------------------------------------
Aladin Akyurek's Profile: http://www.excelforum.com/member.php...nfo&userid=416
View this thread: http://www.excelforum.com/showthread.php?threadid=27810

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Subtotal function with Criteria


Thank you.

Solved my problem.


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
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
Subtotal function with an If criteria Kathy L.[_2_] Excel Discussion (Misc queries) 4 April 2nd 23 08:33 PM
subtotal function using criteria dbroc Excel Worksheet Functions 5 January 10th 10 01:46 AM
Subtotal by 2 different criteria d7 Excel Worksheet Functions 1 February 18th 09 09:41 AM
subtotal - multiple criteria mdma Excel Worksheet Functions 7 August 18th 05 05:19 PM
SUBTOTAL and then count with criteria Jane Excel Worksheet Functions 3 January 13th 05 07:04 AM


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