Earliest January Date

smods

Board Regular
Joined
Feb 18, 2008
Messages
79
Office Version
  1. 365
Platform
  1. Windows
Hello,

Can you help please?

I have a hire date which could be any date in the past and I want to return the last instance of the 31st January in another field Unless the hire date is after the most recent 31st January date

Example 1: Current date is 31st July 2021. Hire date is 1st October 2019. Value should return as 31st January 2021.

Example 2: Current date is 10th January 2021. Hire date is 1st October 2019. Value should return 31st January 2020.

Example 3: Current date is 31st July 2021. Hire date is 15th March 2021. Value should return 15th March 2021 (earliest date January cannot be before the hire date).

Example 4: Current date 1st March 2021. Hire date is 15th April 2021. Value should return “Hire date cannot be before current date”

thank you so much in advance
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
Something like this should do it. The text description, "Hire Date" should refer to the cell with that date.
Excel Formula:
=MAX(DATE(YEAR(EOMONTH(TODAY(),-1)),1,31),"Hire Date")
 
Upvote 0
Solution

Forum statistics

Threads
1,214,987
Messages
6,122,618
Members
449,092
Latest member
amyap

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