Next 5 April from any given date in Excel

shazzaxyz

New Member
Joined
May 8, 2021
Messages
1
Office Version
  1. 365
Platform
  1. Windows
Hi All
I'm trying to return the next 05 April from any given date, with the cell A11 holding the date. I was using this:
=IF(MONTH(A11+1)=4,A11+1,DATE(YEAR(A11)+1,4,5))
Which works fine unless the date I'm using is a month less than 4 (eg jan,feb,march,April) as it will then return to me the 5 April after the one i need, 2021 instead of 2020.

So i then wrote this one, which gives me an error:
=IF(MONTH(A11)<4,(YEAR(A11),month(4),day(05)),(YEAR(A11)+1,month(04),day(05)))
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
73,448
Office Version
  1. 365
Platform
  1. Windows
Hi & welcome to MrExcel.
Maybe
Excel Formula:
=IF(MONTH(A2)<4,DATE(YEAR(A2),4,5),DATE(YEAR(A2)+1,4,5))
 

Rick Rothstein

MrExcel MVP
Joined
Apr 18, 2011
Messages
37,895
Office Version
  1. 2019
  2. 2010
Platform
  1. Windows
@shazzaxyz... Give this formula a try,
Excel Formula:
=DATE(YEAR(A2)+(TEXT(A2,"yyyymmdd")>YEAR(A2)&"0404"),4,5)


@Fluff...check your formula for April 1st through 4th.
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
73,448
Office Version
  1. 365
Platform
  1. Windows
I wouldn't be that surprised if it's wrong as I'm not really sure what the OP is after, I just corrected the OP's 2nd formula.
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,164,681
Messages
5,838,750
Members
430,567
Latest member
carid

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
Top