Checking for date from "last month"...

rickblunt

Well-known Member
Joined
Feb 18, 2008
Messages
609
Office Version
  1. 2019
Platform
  1. Windows
Greetings, I have been noodling on this for a couple of days and I am at a loss as to how to solve this, or even how to phrase the question so that I can search for it on this forum :)

So I have a date in A1 and I just want to know if that date is from last month or not. For example, lets say this is currently October 12 - is the date entered in A1 a date from September? If it is any other date other than from September then I want to be able to create a flag that says "Missed Inspection" or something like that. The date gets updated in the same cell each month so that is why I want to be looking to see if it is "from the last month".

I am thinking that basically I just need to know if it is between the first and last day of the preceding month. I know there is a EOMONTH function but I do not know of a "First of Month" function. Does anyone have any thoughts on how I could go about doing this? I appreciate any input - thanks,
 

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
Maybe
Excel Formula:
=if(month(a1)=month(today())-1,"Missed","Ok")
 
Upvote 0
Solution
Maybe
Excel Formula:
=if(month(a1)=month(today())-1,"Missed","Ok")
oh of course (sound of forehead hitting desk...) because the MONTH function is looking at the month, not the days in the month (well, not directly anyway) I was too hung up on the number of the days in the month. Thanks Fluff, saved me again.
 
Upvote 0

Forum statistics

Threads
1,215,064
Messages
6,122,936
Members
449,094
Latest member
teemeren

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