Need a formula to count the dates that occurred last month

freeb1893

Board Regular
Joined
Jul 30, 2012
Messages
234
Office Version
  1. 365
Platform
  1. Windows
I have a column of dates. I want to create a formula where it looks at that column of dates, and counts the number of cells where the date occurred in the month prior to today. Anyone know how to put that into a formula?
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
Perfect! Also do you know how I could do the same thing, but also reference the column/cell adjacent A1:A51, and only count if the date in the adjacent column B also occurred in the month prior to today?

Code:
=sumproduct(--(isnumber(a1:a51)),--(month(a1:a51)=(month(today())-1)))
 
Upvote 0
Code:
=SUMPRODUCT(--(ISNUMBER(I17:I51)),--(ISNUMBER(H17:H51)),--(MONTH(H17:H51)=(MONTH(TODAY())-1)),--(MONTH(I17:I51)=(MONTH(TODAY())-1)))

You probably don't need the isnumber, it just checks to make sure a cell is not blank.
 
Upvote 0
=SUMPRODUCT(--(MONTH(A1:A51)=MONTH(TODAY())-1),--(MONTH(A1:A51)=MONTH(B1:B51)))

Please note that none of these formulas will check to see if the two dates are in the same year or not.
 
Upvote 0
Hmm something is hanging up this formula. I'm getting the #VALUE! error. Below is some example data. The result of the formula should be 2.

[TABLE="width: 125"]
<tbody>[TR]
[TD]Final Submission[/TD]
[TD]Initial Start[/TD]
[/TR]
[TR]
[TD]6/5/2014[/TD]
[TD="align: right"]6/3/2014[/TD]
[/TR]
[TR]
[TD]6/19/2014[/TD]
[TD="align: right"]6/13/2014[/TD]
[/TR]
[TR]
[TD]6/26/2014[/TD]
[TD="align: right"]6/2/2014[/TD]
[/TR]
[TR]
[TD]6/26/2014[/TD]
[TD="align: right"]6/2/2014[/TD]
[/TR]
[TR]
[TD]7/17/2014[/TD]
[TD="align: right"]6/17/2014[/TD]
[/TR]
[TR]
[TD]7/14/2014[/TD]
[TD="align: right"]7/14/2014[/TD]
[/TR]
[TR]
[TD]7/2/2014[/TD]
[TD="align: right"]7/2/2014[/TD]
[/TR]
[TR]
[TD]7/24/2014[/TD]
[TD="align: right"]7/2/2014[/TD]
[/TR]
[TR]
[TD]7/30/2014[/TD]
[TD="align: right"]7/2/2014[/TD]
[/TR]
[TR]
[TD]8/5/2014[/TD]
[TD="align: right"]7/29/2014[/TD]
[/TR]
[TR]
[TD]8/22/2014[/TD]
[TD="align: right"]8/15/2014[/TD]
[/TR]
[TR]
[TD]8/22/2014[/TD]
[TD="align: right"]8/13/2014[/TD]
[/TR]
[TR]
[TD][/TD]
[TD="align: right"]9/2/2014[/TD]
[/TR]
[TR]
[TD][/TD]
[TD="align: right"]7/9/2014[/TD]
[/TR]
[TR]
[TD][/TD]
[TD="align: right"]6/26/2014[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD="align: right"]7/23/2014[/TD]
[/TR]
[TR]
[TD][/TD]
[TD="align: right"]7/9/2014[/TD]
[/TR]
[TR]
[TD][/TD]
[TD="align: right"]7/9/2014[/TD]
[/TR]
[TR]
[TD][/TD]
[TD="align: right"]7/29/2014[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody><colgroup><col><col></colgroup>[/TABLE]
=SUMPRODUCT(--(MONTH(A1:A51)=MONTH(TODAY())-1),--(MONTH(A1:A51)=MONTH(B1:B51)))

Please note that none of these formulas will check to see if the two dates are in the same year or not.
 
Upvote 0

Forum statistics

Threads
1,222,195
Messages
6,164,511
Members
451,900
Latest member
lamski

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