Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 28
Default SUMIF with Multiple Criteria

=SUMIF(D3:D3001,"014",
G3:G5000)+SUMIF(I4:I10,"<"&DATE(2009,1,1),G4:G10)-SUMIF(I4:I10,"<"&DATE(2009,1,31),G4:G10)

what's wrong with this code? I'm looking to sum everything for building 14
(located in column D) from January 1 to January 31 (Located in column I).
Column G is where the monetary values are....

Thanks for any help!
M
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,104
Default SUMIF with Multiple Criteria

You need to use SUMPRODUCT for multiple criteria
=SUMPRODUCT(--(D3:D3001="014"), --(MONTH(I4:I10+=1), G4:G10)
For more details on SUMPRODUCT
Bob Phillips
http://www.xldynamic.com/source/xld.SUMPRODUCT.html
J.E McGimpsey
http://mcgimpsey.com/excel/formulae/doubleneg.html

If you have Excel 2007 you can use SUMIFS
best wishes

--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"chickalina" wrote in message
...
=SUMIF(D3:D3001,"014",
G3:G5000)+SUMIF(I4:I10,"<"&DATE(2009,1,1),G4:G10)-SUMIF(I4:I10,"<"&DATE(2009,1,31),G4:G10)

what's wrong with this code? I'm looking to sum everything for building 14
(located in column D) from January 1 to January 31 (Located in column I).
Column G is where the monetary values are....

Thanks for any help!
M



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,346
Default SUMIF with Multiple Criteria

Hi,

Try something like this

=SUMPRODUCT(--(D3:D10="014"),--(I4:I10=DATE(2009,1,1)),--(I4:I10<=DATE(2009,1,31)),G4:G10)

But note your logic is different from that which I am using above. For
example your first range D3:D3001 does not match your other criteria ranges.
Your formula misses Jan 31.
--
If this helps, please click the Yes button.

Cheers,
Shane Devenshire


"chickalina" wrote:

=SUMIF(D3:D3001,"014",
G3:G5000)+SUMIF(I4:I10,"<"&DATE(2009,1,1),G4:G10)-SUMIF(I4:I10,"<"&DATE(2009,1,31),G4:G10)

what's wrong with this code? I'm looking to sum everything for building 14
(located in column D) from January 1 to January 31 (Located in column I).
Column G is where the monetary values are....

Thanks for any help!
M

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,651
Default SUMIF with Multiple Criteria

I'm a bit confused as to what you are trying to do. You seem to be testing
column I dates in rows 4 to 10, but column D values in rows 3 to 3001.

Your 2nd and 3rd terms will subtract those values beween G4 and G10 which
correspond to column I dates from 1 to 30 January 2009 (not 31st, because
you've tested for *less than* 31st), but your first term isn't valid because
the ranges are of different lengths (to 3001 in D, but to row 5000 in G).

If you correct the array lengths in the first part, that will add those
values in G3 to G3001 (or to G5000) for which the corresponding column D
value is "014". After that your 2nd and 3rd terms will subtract the
selected (1 to 30 January 2009) values within your shorter range (rows 4 to
10).

If all your ranges were the same length and you were looking at rows where
columns D and I both met the specified criteria, you would use SUMPRODUCT.
--
David Biddulph

chickalina wrote:
=SUMIF(D3:D3001,"014",
G3:G5000)+SUMIF(I4:I10,"<"&DATE(2009,1,1),G4:G10)-SUMIF(I4:I10,"<"&DATE(2009,1,31),G4:G10)

what's wrong with this code? I'm looking to sum everything for
building 14 (located in column D) from January 1 to January 31
(Located in column I). Column G is where the monetary values are....

Thanks for any help!
M



  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,346
Default SUMIF with Multiple Criteria

Hi,

In 2007

=SUMIFS(G3:G10,D3:D10,"014",I3:I10,"="&DATE(2009, 1,1),I3:I10,"<="&DATE(2009,1,31))

In my prevous post I failed to notice that you are running some ranges from
row 3 and others from row 4. All ranges must be of equal size for these
formulas, so you should correct my previous suggestion accordingly.


--
If this helps, please click the Yes button.

Cheers,
Shane Devenshire


"chickalina" wrote:

=SUMIF(D3:D3001,"014",
G3:G5000)+SUMIF(I4:I10,"<"&DATE(2009,1,1),G4:G10)-SUMIF(I4:I10,"<"&DATE(2009,1,31),G4:G10)

what's wrong with this code? I'm looking to sum everything for building 14
(located in column D) from January 1 to January 31 (Located in column I).
Column G is where the monetary values are....

Thanks for any help!
M



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,104
Default SUMIF with Multiple Criteria

A typo!
=SUMPRODUCT(--(D3:D3001="014"), --(MONTH(I4:I10)=1), G4:G10)


--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"Bernard Liengme" wrote in message
...
You need to use SUMPRODUCT for multiple criteria
=SUMPRODUCT(--(D3:D3001="014"), --(MONTH(I4:I10+=1), G4:G10)
For more details on SUMPRODUCT
Bob Phillips
http://www.xldynamic.com/source/xld.SUMPRODUCT.html
J.E McGimpsey
http://mcgimpsey.com/excel/formulae/doubleneg.html

If you have Excel 2007 you can use SUMIFS
best wishes

--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"chickalina" wrote in message
...
=SUMIF(D3:D3001,"014",
G3:G5000)+SUMIF(I4:I10,"<"&DATE(2009,1,1),G4:G10)-SUMIF(I4:I10,"<"&DATE(2009,1,31),G4:G10)

what's wrong with this code? I'm looking to sum everything for building
14
(located in column D) from January 1 to January 31 (Located in column I).
Column G is where the monetary values are....

Thanks for any help!
M





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
SUMPRODUCT / SUMIF on Multiple Worksheets with Multiple Criteria kazoo Excel Discussion (Misc queries) 2 August 21st 08 06:22 PM
SUMIF with multiple criteria ricky[_2_] Excel Discussion (Misc queries) 4 July 7th 07 08:06 PM
SUMIF with multiple criteria Plum Excel Discussion (Misc queries) 4 April 21st 07 06:31 PM
SUMIF for Multiple Criteria PCakes Excel Worksheet Functions 2 October 20th 06 05:53 PM
sumif with multiple criteria benb Excel Worksheet Functions 3 January 5th 05 11:07 PM


All times are GMT +1. The time now is 09:13 AM.

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"