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
|