Solved

Date help, within 60 days of Aug 6 and Feb 6

Posted on 2014-10-17
4
142 Views
Last Modified: 2014-10-17
experts, how can I modify the below to show a date that is 60 days after Aug 6 or Feb 6?  The below shows a date that is 60 days after Jan15 and July 15

=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)


thank you
0
Comment
Question by:pdvsa
  • 2
4 Comments
 
LVL 68

Expert Comment

by:Qlemo
Comment Utility
=DATE(YEAR(NOW()),CHOOSE(8, MONTH(NOW()),IF(DAY(NOW())>6,8,2),8,8,8,8,8,IF(DAY(NOW())>6,14,8),14,14,14,14)+2,6)

Open in new window

However, if you use such a formula, you should try to understand what it does, and why.
0
 
LVL 50

Accepted Solution

by:
barry houdini earned 500 total points
Comment Utility
Qlemo

I don't think your formula is working as intended, you have 8 as the first argument of CHOOSE function so that defeats the purpose of CHOOSE - I'd expect the first argument to be MONTH(NOW()) as per the original.

pdvsa,

I think it's more accurate to say that your original formula will add 2 months (not 60 days) to today's date and then return the next 15th March or 15th September date (whichever comes first). This formula will do that using a different approach

=LOOKUP(EDATE(TODAY(),8)-1,DATE(YEAR(TODAY()),{3,9,15},15))

If you want to do the same but show 6th April or 6th October then this formula will do that:

=LOOKUP(EDATE(TODAY(),8)-1,DATE(YEAR(TODAY()),{4,10,16},6))

The only difference is the numbers at the end based on the cut-off dates you want

regards, barry
0
 

Author Closing Comment

by:pdvsa
Comment Utility
Thank you.  I used the second formula.  Works perfectly.
0
 
LVL 50

Expert Comment

by:barry houdini
Comment Utility
Actually, there's an even simpler way, if you want.

=COUPNCD(EDATE(TODAY(),2),DATE(9999,10,6),2)

That will give the same results as the second formula above

regards, barry
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
Improved? Move/Copy Add-in Replacement - How to avoid the annoying, “A formula or sheet you want to move or copy contains the name XXX, which already exists on the destination worksheet.” David Miller (dlmille)  It was one of those days… I wa…
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …

762 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

12 Experts available now in Live!

Get 1:1 Help Now