Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 08-08-2024, 07:08 AM
wsnow wsnow is offline Calculate date due from variable date to semi-fixed date Windows 10 Calculate date due from variable date to semi-fixed date Office 2019
Novice
Calculate date due from variable date to semi-fixed date
 
Join Date: Sep 2023
Posts: 24
wsnow is on a distinguished road
Default Calculate date due from variable date to semi-fixed date

=IF(ISBLANK([@[Declaration Date]]),"", DATE(YEAR([@[Declaration Date]])+1,MONTH(3),DAY(31)))



I wrote the above to calculate the due date for new applications based on the declaration date on an event. The due date is always 3/31 in the calendar year following the year after the event, no matter what month/day.

The above formula is returning the correct year and day, but no matter what number I put after MONTH, the result is 1/31/XXXX rather than 3/31/XXXX. Excel not returning any error message on formula.

What did I do wrong?

Thanks.
Reply With Quote
  #2  
Old 08-08-2024, 12:12 PM
p45cal's Avatar
p45cal p45cal is offline Calculate date due from variable date to semi-fixed date Windows 10 Calculate date due from variable date to semi-fixed date Office 2021
Expert
 
Join Date: Apr 2014
Posts: 956
p45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond repute
Default

=IF(ISBLANK([@[Declaration Date]]),"", DATE(YEAR([@[Declaration Date]])+1,3,31))
?

Re: "no matter what number I put after MONTH"
For silliness, try 65.
Reply With Quote
  #3  
Old 08-08-2024, 03:08 PM
wsnow wsnow is offline Calculate date due from variable date to semi-fixed date Windows 10 Calculate date due from variable date to semi-fixed date Office 2019
Novice
Calculate date due from variable date to semi-fixed date
 
Join Date: Sep 2023
Posts: 24
wsnow is on a distinguished road
Default

Okay, you HAVE to explain to me why that worked!!!!
Reply With Quote
  #4  
Old 08-08-2024, 11:04 PM
ArviLaanemets ArviLaanemets is offline Calculate date due from variable date to semi-fixed date Windows 8 Calculate date due from variable date to semi-fixed date Office 2016
Expert
 
Join Date: May 2017
Posts: 949
ArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant future
Default

Quote:
Originally Posted by wsnow View Post
Okay, you HAVE to explain to me why that worked!!!!
It's better to explain why your formula didn't work!
MONTH(3) returns the month of date 1/3/1900 (i.e. 1, as it will be January);
DAY(31) returns the day of date 1/31/1900.

The syntax of DATE() function is:
DATE(YearNumber, MonthNumber, DayNumber)
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Calculate date due from variable date to semi-fixed date Calculate due date with variable based on different start dates. wsnow Excel 4 04-24-2024 09:38 AM
Calculate date due from variable date to semi-fixed date Calculate date from two variable fields, with no #value error in empty rows wsnow Excel 4 09-22-2023 05:55 AM
Use Original Award Date or Mod Award Date For Date-Based Recurring Tasks KBCasey27 Project 1 04-30-2021 12:22 AM
Calculate date due from variable date to semi-fixed date Calculate a Date shawn.low@cox.net Mail Merge 5 12-12-2019 03:22 PM
calculate date if date entered in cell, do nothing if blank ConfuddledOne Excel 3 11-07-2014 09:37 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 07:23 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft