DATEVALUE and using Cell Referencing

shaun86

New Member
Joined
Oct 20, 2017
Messages
16
I am trying to have a cell count the number of cells within a range to find how many have dates that fall between specific dates but getting the #VALUE ! error. My formula is:

=SUMPRODUCT((DeliveryDate>=DATEVALUE(Month1))*(DeliveryDate<=DATEVALUE(EndMonth1)))

Month1's formula is =EDATE(C2,1) referencing a cell with a formula displaying the first day of the current month. Basically I'm trying to set it up so I won't have to manually go through and change the months around, I'll just be able to drop in the info I need on a separate sheet and the main sheet will fill itself in. Am I referencing one too many cells here for my SUMPRODUCT formula? When I change it to this:

=SUMPRODUCT((DeliveryDate>=DATEVALUE("1/1/2018"))*(DeliveryDate<=DATEVALUE("1/31/2018")))

This works fine, but I figured using cell referencing I'd be able to forgo the entering in the date part. Any insight would be greatly appreciated.
 
Last edited:

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
The EDATE formula returns a date. So you don't need to use the DATEVALUE function on it. That is just used to convert a Text entry to a Date one. Using it on a Date will return the #VALUE error.
So just try:
Code:
[COLOR=#333333]=SUMPRODUCT((DeliveryDate>=Month1)*(DeliveryDate<=EndMonth1))[/COLOR]
 
Upvote 0
Yes that worked perfectly, thanks! Was just overthinking it (or more accurately not understanding it).
 
Upvote 0

Forum statistics

Threads
1,223,904
Messages
6,175,295
Members
452,631
Latest member
a_potato

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top