Check if date is between 2 dates

I see a solution for this question using visual basic, however I am looking to use it in an Excel function. In the example attached I want to sum a range of values if the date is between two other dates.

I know I can sum if the date is greater or less than a specified date:

 =SUMIF($A2:$A4,"<39814",C$2:C$4) where the criteria is the Excel date as a serial number (in this case, before 1/1/09).

How can I do this if I want to sumif the date is between two dates? I tried this:

=SUMIF($A2:$A4,AND("<398149",">=39448"),B$2:B$4) where the criteria is supposed to be any date in 2008.

I get a result of 0.

Also, I want to reference cells containing the date, not the Excel date serial value. See the attached example.

Who is Participating?
barry houdiniConnect With a Mentor Commented:
...obviously you wouldn't normally have the criteria dates as part of the criteria range, that was just by way of example....criteria dates, A4 and A5 should ideally be in different cells. Note that for a whole year only you could use YEAR function like this:


regards, barry
barry houdiniCommented:
You can use SUMPRODUCT like this


regards, barry
Arno KosterCommented:
or from excel version 2003 you could also use


to get the total for 2009
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Or if you really like sumif

Plug this formula into your cell

The long-winded way.
orerockonAuthor Commented:
Exactly what I was looking for thanks!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.