View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.newusers
Elkar
 
Posts: n/a
Default Summing one column based on date in another column

Ah, yes, that would be a problem when searching for January since a blank
cell assumes month 1.

Try this:

=SUMPRODUCT(D1:D8,--(MONTH(A1:A8)=1),--(A1:A8<""))

This will add the additional condition of not being blank.

HTH,
Elkar

"excel guru i''m not" wrote:

New problem. When I use this formula it is counting the dollars in the date
columns that are blank. Do you know how I would fix this?

"Elkar" wrote:

For this example I'll assume date is in column A and amount is in column B:

If you're just interested in a specific month (january) you could use this:

=SUMPRODUCT(B1:B100,--(MONTH(A1:A100)=1))

Or, if you want to easily be able to change the month being summed, you
could place the number of the month in a seperate cell (we'll say C1 for
example) and use this:

=SUMPRODUCT(B1:B100,--(MONTH(A1:A100)=C1))

HTH,
Elkar

"excel guru i'm not" wrote:

I desperately need help here. I have a spreadsheet that has sales price in
one column and the date in another column. It will only add if the date is
the month only i.e., January vs January 1, 2005. I need it to add by month
based on all days within the month because that column has to have the actual
date not just the month.