my formula isnt working because of date formatting

bigdan

Well-known Member
Joined
Oct 5, 2009
Messages
846
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

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
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

<colgroup><col style="width: 25pxpx"><col><col></colgroup><thead>
</thead><tbody>
[TD="align: center"]1[/TD]
[TD="align: center"]7/5/2019[/TD]
[TD="align: center"]1[/TD]

[TD="align: center"]2[/TD]
[TD="align: center"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]3[/TD]
[TD="align: center"]05-Jul-2019[/TD]
[TD="align: right"][/TD]

</tbody>
Sheet1

[TABLE="width: 85%"]
<tbody>[TR]
[TD]Worksheet Formulas[TABLE="width: 100%"]
<thead>[TR="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FFFFFF]#FFFFFF[/URL] "]
[TH="width: 10px"]Cell[/TH]
[TH="align: left"]Formula[/TH]
[/TR]
</thead><tbody>[TR]
[TH="width: 10px, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FFFFFF]#FFFFFF[/URL] "]B1[/TH]
[TD="align: left"]=SUMPRODUCT(--(A1=DATE(2019,7,5)))[/TD]
[/TR]
[TR]
[TH="width: 10px, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FFFFFF]#FFFFFF[/URL] "]A3[/TH]
[TD="align: left"]=TEXT(DATE(2019,7,5),"DD-MMM-YYYY")[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]
 
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,223,903
Messages
6,175,284
Members
452,630
Latest member
OdubiYouth

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