willow1985
Well-known Member
- Joined
- Jul 24, 2019
- Messages
- 929
- Office Version
- 365
- Platform
- Windows
Hello,
Can anyone help me with a formula that counts invoice dates?
Not sure if CountIF can do this or not
Basically count how many items were invoiced in the current month and then another formula to count how many in the previous month Both for the current year.
The formulas I am currently using seem to have errors and do not account for the current year:
=SUMPRODUCT(--(TEXT('WO Report'!M2:M1000001,"mmyyyy")=TEXT(TODAY(),"mmyyyy")))
=SUMPRODUCT(--(TEXT('WO Report'!M2:M1000001,"mmyyyy")=TEXT(EDATE(TODAY(),-1),"mmyyyy")))
For the first formula I should be getting a result of 260 but I am getting a result of 266 and
for the 2nd I should be getting a result of 258 instead I am getting 269 and I do not know why.
Here is the data:
[TABLE="width: 530"]
<colgroup><col span="2"><col span="6"></colgroup><tbody>[TR]
[TD]Tab Names: WO Report[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Tab Name: Tables[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Column M[/TD]
[TD][/TD]
[TD]Column V[/TD]
[TD][/TD]
[TD]Column S[/TD]
[TD][/TD]
[TD][/TD]
[TD]Current Month B14[/TD]
[/TR]
[TR]
[TD]Invoice Date[/TD]
[TD][/TD]
[TD]Month[/TD]
[TD][/TD]
[TD]Current Year[/TD]
[TD][/TD]
[TD][/TD]
[TD]Previous Month B15[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]2019-09-01[/TD]
[TD][/TD]
[TD]September[/TD]
[TD][/TD]
[TD]2019[/TD]
[TD][/TD]
[TD][/TD]
[TD]Formula[/TD]
[/TR]
[TR]
[TD]2019-09-25[/TD]
[TD][/TD]
[TD]September[/TD]
[TD][/TD]
[TD]2019[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]2019-08-11[/TD]
[TD][/TD]
[TD]August[/TD]
[TD][/TD]
[TD]2019[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]2018-08-01[/TD]
[TD][/TD]
[TD]August[/TD]
[TD][/TD]
[TD]2018[/TD]
[TD]
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Answer should be for this data: 2 for current month and 1 for previous month
Thank you guys for your help!
Carla
Can anyone help me with a formula that counts invoice dates?
Not sure if CountIF can do this or not
Basically count how many items were invoiced in the current month and then another formula to count how many in the previous month Both for the current year.
The formulas I am currently using seem to have errors and do not account for the current year:
=SUMPRODUCT(--(TEXT('WO Report'!M2:M1000001,"mmyyyy")=TEXT(TODAY(),"mmyyyy")))
=SUMPRODUCT(--(TEXT('WO Report'!M2:M1000001,"mmyyyy")=TEXT(EDATE(TODAY(),-1),"mmyyyy")))
For the first formula I should be getting a result of 260 but I am getting a result of 266 and
for the 2nd I should be getting a result of 258 instead I am getting 269 and I do not know why.
Here is the data:
[TABLE="width: 530"]
<colgroup><col span="2"><col span="6"></colgroup><tbody>[TR]
[TD]Tab Names: WO Report[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Tab Name: Tables[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Column M[/TD]
[TD][/TD]
[TD]Column V[/TD]
[TD][/TD]
[TD]Column S[/TD]
[TD][/TD]
[TD][/TD]
[TD]Current Month B14[/TD]
[/TR]
[TR]
[TD]Invoice Date[/TD]
[TD][/TD]
[TD]Month[/TD]
[TD][/TD]
[TD]Current Year[/TD]
[TD][/TD]
[TD][/TD]
[TD]Previous Month B15[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]2019-09-01[/TD]
[TD][/TD]
[TD]September[/TD]
[TD][/TD]
[TD]2019[/TD]
[TD][/TD]
[TD][/TD]
[TD]Formula[/TD]
[/TR]
[TR]
[TD]2019-09-25[/TD]
[TD][/TD]
[TD]September[/TD]
[TD][/TD]
[TD]2019[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]2019-08-11[/TD]
[TD][/TD]
[TD]August[/TD]
[TD][/TD]
[TD]2019[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]2018-08-01[/TD]
[TD][/TD]
[TD]August[/TD]
[TD][/TD]
[TD]2018[/TD]
[TD]
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Answer should be for this data: 2 for current month and 1 for previous month
Thank you guys for your help!
Carla