Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
jlpwilley
 
Posts: n/a
Default How do I add a second criteria to the SUMIF or DSUM function?

I am using Excel 2003 and I need to write a function to select numbers in a
column based on two separate criteria and then sum those selected numbers. I
have tried SUMIF and DSUM but either these functions will not allow a second
criteria to be added or I am doing it wrong. Any suggestions would be
appreciated
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
bpeltzer
 
Posts: n/a
Default How do I add a second criteria to the SUMIF or DSUM function?

Sumif doesn't support multiple criteria (you'd have to use sumproduct
instead, generate arrays of true/false which get converted to 1/0). DSUM
certainly supports multiple criteria. Your criteria range would have to be
multiple columns, with the column headers matching those columns of your data
range you want to filter.
Could you provide more info, say what you've got so far and what you're
trying to do?
--Bruce

"jlpwilley" wrote:

I am using Excel 2003 and I need to write a function to select numbers in a
column based on two separate criteria and then sum those selected numbers. I
have tried SUMIF and DSUM but either these functions will not allow a second
criteria to be added or I am doing it wrong. Any suggestions would be
appreciated

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
John Michl
 
Posts: n/a
Default How do I add a second criteria to the SUMIF or DSUM function?

You can't but you could use a SUMPRODUCT function to accomplish the
same thing. Try:

=SUMPRODUCT(--(A1:A10="A"), --(B1:B10)="B",C1:C10)

Hope that helps.

- John Michl

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
SumIF function ACDenver Excel Discussion (Misc queries) 2 August 17th 05 09:47 PM
conditional criteria in DSUM S. H. Drew Excel Discussion (Misc queries) 7 May 2nd 05 06:14 PM
Is it possible to use the sumif function based on the criteria of. Shelba Excel Worksheet Functions 1 February 2nd 05 05:40 AM
SUMIF function - criteria of between two dates. How? Frannie21 Excel Worksheet Functions 4 January 27th 05 03:28 PM
DSum function Mark Excel Worksheet Functions 2 November 17th 04 02:47 PM


All times are GMT +1. The time now is 05:55 AM.

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"