my formula isnt working because of date formatting

bigdan

Well-known Member
Joined
Oct 5, 2009
Messages
840
Office Version
  1. 2013
Platform
  1. Windows
I'm trying to use a sumproduct formula but it's not working because of date formatting. I know it's date related because I was able to make it work on made up dates.

So if I was to type in smth like "7/5" without the quotes Excel would read that as July 5 2019 and display it as "05-Jul". If I were to put my cursor on that the address bar would say "07/05/2019".

The problem with the source data is it's displayed as "2019-07-05".

I would've thought that wouldn't be a big deal but apparently it is. The **** formula isn't working. Can anyone help?

FYI I'm using sumproduct to find the results within a certain range of dates. For this example let's say I need dates within Jul 1 and Jul 7.
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
formula isn't working how?
is it reading your source date 2019-07-05 as may 7th but you want jul 5th?
or is it giving you a #VAL error or something because the source date is being read as text instead of a number?
can you post your formula?
 
Upvote 0
I am not sure if this work for your case.


Excel 2013/2016
AB
17/5/20191
2
305-Jul-2019
Sheet1
Cell Formulas
RangeFormula
B1=SUMPRODUCT(--(A1=DATE(2019,7,5)))
A3=TEXT(DATE(2019,7,5),"DD-MMM-YYYY")
 
Upvote 0
Correct, I get a #VALUE ! error. Here's the formula. Sorry it's so ugly!

=SUMPRODUCT(--(AB1:AB139478="Completed")*(V1:V139478=W139491)*(B1:B139478>=U139493)*(B1:B139478<=V139493)*AN1:AN139478)

I tried this formula on an experimental range with dates I made up and it worked just fine.


formula isn't working how?
is it reading your source date 2019-07-05 as may 7th but you want jul 5th?
or is it giving you a #VAL error or something because the source date is being read as text instead of a number?
can you post your formula?
 
Upvote 0
Thanks Sam.
This seems manual, right? Would one have to modify this formula for every row? In my spreadsheet there's over 100K lines :$


I am not sure if this work for your case.

Excel 2013/2016
AB
17/5/20191
2
305-Jul-2019

<colgroup><col style="width: 25pxpx"><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet1

Worksheet Formulas
CellFormula
B1=SUMPRODUCT(--(A1=DATE(2019,7,5)))
A3=TEXT(DATE(2019,7,5),"DD-MMM-YYYY")

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>
 
Upvote 0
Something like this.


Excel 2013/2016
ABCDE
1DatePoints
207/05/1910B-Date07/05/19
307/06/1922E-Date07/20/19
407/07/1934Net66
Sheet28
Cell Formulas
RangeFormula
E4=SUMPRODUCT(--(INT($A$2:$A$4)>=$E$2),--(INT($A$2:$A$4)<=$E$3),--($B$2:$B$4))
 
Upvote 0

Forum statistics

Threads
1,214,430
Messages
6,119,443
Members
448,898
Latest member
drewmorgan128

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