Solved

Date help, 60 days after of Jan and July

Posted on 2014-09-25
5
195 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 33

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes how you can use Custom Document Properties to store settings and other information in your workbook so that they will be available the next time you open the workbook.
After seeing numerous questions for Dynamic Data Validation I notice that most have used Visual Basic to solve the problem. This suggestion is purely formula based and can be used in multiple rows.
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

623 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