Solved

Date help, 60 days after of Jan and July

Posted on 2014-09-25
5
172 Views
Last Modified: 2014-09-25
Experts,

I need a formula for 60 days after Jan 15 and July 15.  

ie:  today is 9/25/2014 so the return would show 60 days after July 15 which is Sept 15.  
Once past July 15 then the return would show 60 days after Jan15 which is Mar15.

this formula shows either Jan 15 or July 15.  I think the solution is to modify the below formula to add 60 days.
but I dont understand where to add the days.  

=DATE(YEAR(NOW()),CHOOSE(MONTH(NOW()),IF(DAY(NOW())>15,7,1),7,7,7,7,7,IF(DAY(NOW())>15,13,7),13,13,13,13,13),15)
thank you
0
Comment
Question by:pdvsa
5 Comments
 
LVL 27

Accepted Solution

by:
Glenn Ray earned 500 total points
ID: 40343975
Well, first of all, 60 days AFTER January 15 can be either
March 16 - if a non-leap year
March 15 - if a leap year.

And 60 days AFTER July 15 is ALWAYS September 13.

To modify your formula to get these dates:
=DATE(YEAR(NOW()),CHOOSE(MONTH(NOW()),IF(DAY(NOW())>15,7,1),7,7,7,7,7,IF(DAY(NOW())>15,13,7),13,13,13,13,13),75)

Just added 60 to the final day amount (from 15 to 75)

-Glenn
0
 
LVL 24

Expert Comment

by:Phillip Burton
ID: 40343984
You may want to understand my code:

=DATE(YEAR(NOW())

Open in new window


This contains the year for the answer:

,CHOOSE(MONTH(NOW()),

Open in new window


This is going to be the month of the answer, and you are telling to computer that it is going to be based on the current month:

IF(DAY(NOW())>15,7,1),7,7,7,7,7,IF(DAY(NOW())>15,13,7),13,13,13,13,13)

Open in new window


These are the month of the answer, one value of each month we are currently in. A "13" means January of next year.

,75)

Open in new window


This is the month you are using. This is therefore the 15th day plus another 60 days.

Hope this helps you understand the code.
0
 

Author Closing Comment

by:pdvsa
ID: 40344017
thank you.  Its still a lot to understand however I do understand the edit from 15 to 75.
0
 
LVL 31

Expert Comment

by:Rob Henson
ID: 40344024
With addition to my previous suggestion using EOMONTH:

=EOMONTH(TODAY(),IF(AND(DAY(TODAY())<16,OR(MONTH(TODAY())=1,MONTH(TODAY())=7)),-1,IF(MONTH(TODAY())<7,6,12)-MONTH(TODAY())))+15+60

The +15+60 could obviously be changed to +75

Thanks
Rob H
0
 
LVL 27

Expert Comment

by:Glenn Ray
ID: 40344247
On the other hand, if you indeed wanted to return these values always (i.e., two MONTHS) after cutoff:
July 15 ---> September 15
January 15 ---> March 15

then the formula would be more like this:
=DATE(YEAR(NOW()),CHOOSE(MONTH(NOW()),IF(DAY(NOW())>15,7,1),7,7,7,7,7,IF(DAY(NOW())>15,13,7),13,13,13,13,13)+2,15)

This adds 2 to the chosen month and leaves the day value (15) constant.

-Glenn
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

INDEX and MATCH can be used to great effect to replace HLOOKUP and VLOOKUP as it does not have the limitation of needing the data to be sorted so that the reference value is in the first column or row. It also has the ability to perform a bi-directi…
Convert between Excel file formats (.XLS, .XLSX, .XLSM) with/without macro option David Miller (dlmille) Intro Over this past Fall, I've had the opportunity to see several similar requests and have developed a couple related solutions associate…
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now