How to compare a cell containing a date in sumif criteria

R

Retired Nick

I have a sumif function to return a report from a worksheet and would like to
make the condition refer to another cell (in the same workbook).

E.g.

This works...

A2: =SUMIF(A5:A100,">=11/01/07",E5:E100)

But this doesn't...

A1: 11/01/07
A2: =SUMIF(A5:A100,">="&A1,E5:E100)

A5: 11/20/07
A6: 12/20/07
A7: 08/20/07
....

How do I make the condition be that the range has to be greater than the
date in cell A1?

Thanks for your help.
 
P

PCLIVE

It works for me. Check to make sure that the dates in your range are actual
dates and not just text.

Regards,
Paul
 
B

Bernard Liengme

Or try =SUMIF(A5:A100,DATE(2007,01,11),E5:E100)
Note clear from you example what date format you use - I took 01 as month
best wishes
 
R

Retired Nick

Thanks but the reason that I want a cell to contain the criteria date is
because I have a number of similar queries and I don't want to go updating
each of the formulas every time the date changes
 
P

PCLIVE

Try changing the format of A5 (from your example) to General. If it was a
true date, then it should change to 39406. If does not do that and it still
shows 11/20/07, then the contents in A5 is not being seen as an actual date.
Look for leading or trailing spaces or unseen characters.

You might try this formula instead.

=SUMPRODUCT(--(A5:A100>=A1),E5:E100)

Does that help?
Paul

--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top