Need a formula to count the dates that occurred last month

freeb1893

Board Regular
Joined
Jul 30, 2012
Messages
233
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

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
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.

Final SubmissionInitial Start
6/5/20146/3/2014
6/19/20146/13/2014
6/26/20146/2/2014
6/26/20146/2/2014
7/17/20146/17/2014
7/14/20147/14/2014
7/2/20147/2/2014
7/24/20147/2/2014
7/30/20147/2/2014
8/5/20147/29/2014
8/22/20148/15/2014
8/22/20148/13/2014
9/2/2014
7/9/2014
6/26/2014
7/23/2014
7/9/2014
7/9/2014
7/29/2014

<tbody>
</tbody><colgroup><col><col></colgroup>
=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,214,646
Messages
6,120,718
Members
448,986
Latest member
andreguerra

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