Date formula Help!

RLJ

Active Member
Joined
Mar 15, 2011
Messages
417
Office Version
  1. 365
Platform
  1. Windows
I need some help figuring out a set of formulas to display some dates. In the example below, Column B works since the Work Date is 11/128/2023. Column E does not work since the date is 1/11/2024. I need the dates in column H.

These dates are annual review dates and when in 2023, the dates all work since all is more than 2 months out from the Work Date of 11/18/2023. The dates in Column E do not work because some are less than 2 months out from the work date and some are more than 2 months out from the Work Date of 1/11/2024.

Since the Work Date is 1/11/2024 and 2 months is 3/11/2024, the 60 day value of 3/1/2025 is good, but the 90, 120, 150 & 180 dates are more than 2 months from the Work Date and I need to have the 2024 values vs the 2025 values. Column H is what I would like the formulas to produce.

Basically, I need the formulas to look at the 2 months from Work Date and if they are less, return the next years values and if they are greater, display the current year values.

Sample Date.xlsx
ABCDEFGH
1GoodBadWhat I need
2Work Date11/18/2023Work Date1/11/2024Work Date1/11/2024
3Next Year1/1/2024Next Year1/1/2025Next Year1/1/2025
460 Days from YE3/1/202460 Days from YE3/1/202560 Days from YE3/1/2025
590 Days from YE4/1/202490 Days from YE4/1/202590 Days from YE4/1/2024
6120 Days from YE5/1/2024120 Days from YE5/1/2025120 Days from YE5/1/2024
7150 Days from YE6/1/2024150 Days from YE6/1/2025150 Days from YE6/1/2024
8180 Days from YE7/1/2024180 Days from YE7/1/2025180 Days from YE7/1/2024
9
10
11Workdate + 2 months3/11/2024
Sheet1
Cell Formulas
RangeFormula
H3,E3,B3H3=DATE(YEAR(H2),12,31)+1
H4,E4,B4H4=DATE(YEAR(H3),MONTH(H3)+2,DAY(1))
B5,E5B5=DATE(YEAR(B3),MONTH(B3)+3,DAY(1))
B6,E6B6=DATE(YEAR(B3),MONTH(B3)+4,DAY(1))
B7,E7B7=DATE(YEAR(B3),MONTH(B3)+5,DAY(1))
B8,E8B8=DATE(YEAR(B3),MONTH(B3)+6,DAY(1))
E11E11=DATE(YEAR($E$2),MONTH($E$2)+2,DAY($E$2))


Thank you for your help!
 
So YE= yearly event, and not Year End, as I was assuming.

Does this logical argument fit your situation, or is it something else?

If (workdate+2mos) > (YE+2mos) return (YE+2mos) otherwise return (YE+14 mos)
 
Upvote 0

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
Have a look at these and see if NEW works for all the scenarios you might need. I can combine the helper columns into one formula once I know if it meets your needs.

NEW: IF (WD+2mos) > (TY+#mos) , return (NY+#mos) otherwise (TY+#mos)

2024-01-12_Workdate.xlsx
DEHIJKMNOPSTUVX
1Good OriginalNEWWD18-Nov-23GoodNEW 3WD12-Jan-24
2Work Date - WD18-Nov-23NextYear1-Jan-24Work Date - WD11-Jan-24NextYear1-Jan-25
3Next Year (Jan. 1) - NY1-Jan-24#mosNY+mosTY+mosNext Year (Jan. 1) - NY1-Jan-25#mosNY+mosTY+mos
4ThisYear (Jan. 1) - TY1-Jan-23ThisYear (Jan. 1) - TY1-Jan-24
560 Days from YE1-Mar-241-Mar-2421-Mar-241-Mar-2360 Days from YE1-Mar-251-Mar-2521-Mar-251-Mar-24
690 Days from YE1-Apr-241-Apr-2431-Apr-241-Apr-2390 Days from YE1-Apr-241-Apr-2431-Apr-251-Apr-24
7120 Days from YE1-May-241-May-2441-May-241-May-23120 Days from YE1-May-241-May-2441-May-251-May-24
8150 Days from YE1-Jun-241-Jun-2451-Jun-241-Jun-23150 Days from YE1-Jun-241-Jun-2451-Jun-251-Jun-24
9180 Days from YE1-Jul-241-Jul-2461-Jul-241-Jul-23180 Days from YE1-Jul-241-Jul-2461-Jul-251-Jul-24
10
11
12Workdate + 2 months18-Jan-24Workdate + 2 months12-Mar-24
Sheet3
Cell Formulas
RangeFormula
K1K1=E2
K2,P3,E3,V2K2=DATE(YEAR(K1),12,31)+1
E4,P4E4=DATE(YEAR(K1),1,1)
E5E5=DATE(YEAR(E3),MONTH(E3)+2,DAY(1))
S5:S9,H5:H9H5=IF(E$12>M5,K5,M5)
E6E6=DATE(YEAR(E3),MONTH(E3)+3,DAY(1))
E7E7=DATE(YEAR(E3),MONTH(E3)+4,DAY(1))
E8E8=DATE(YEAR(E3),MONTH(E3)+5,DAY(1))
E9E9=DATE(YEAR(E3),MONTH(E3)+6,DAY(1))
K5:K9K5=EDATE($K$2,$J5)
M5:M9M5=EDATE($E$4,J5)
P5P5=IF(MONTH(EDATE($P$3,2))>MONTH($P$12),DATE(YEAR(EDATE($P$3,2))-1,MONTH(EDATE($P$3,2)),1),EDATE($P$3,2))
P6P6=IF(MONTH(EDATE($P$3,3))>MONTH($P$12),DATE(YEAR(EDATE($P$3,3))-1,MONTH(EDATE($P$3,3)),1),EDATE($P$3,3))
P7P7=IF(MONTH(EDATE($P$3,4))>MONTH($P$12),DATE(YEAR(EDATE($P$3,4))-1,MONTH(EDATE($P$3,4)),1),EDATE($P$3,4))
P8P8=IF(MONTH(EDATE($P$3,5))>MONTH($P$12),DATE(YEAR(EDATE($P$3,5))-1,MONTH(EDATE($P$3,5)),1),EDATE($P$3,5))
P9P9=IF(MONTH(EDATE($P$3,6))>MONTH($P$12),DATE(YEAR(EDATE($P$3,6))-1,MONTH(EDATE($P$3,6)),1),EDATE($P$3,6))
V5:V9V5=EDATE($V$2,$U5)
X5X5=EDATE($P$4,$U5)
X6:X9X6=EDATE($P$4,U6)
E12E12=EDATE($K$1,2)
P12P12=EDATE($V$1,2)
 
Upvote 0

Forum statistics

Threads
1,215,073
Messages
6,122,970
Members
449,095
Latest member
Mr Hughes

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