Solved

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

Posted on 2014-10-17
4
150 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
[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
  • 2
4 Comments
 
LVL 70

Expert Comment

by:Qlemo
ID: 40387079
=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
ID: 40387278
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
ID: 40387328
Thank you.  I used the second formula.  Works perfectly.
0
 
LVL 50

Expert Comment

by:barry houdini
ID: 40387350
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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

How to quickly and accurately populate Word documents with Excel data, charts and images (including Automated Bookmark generation) David Miller (dlmille) Synopsis In this article you’ll learn how to use ExcelToWord! to copy data,charts, shapes …
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

729 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