Solved

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

Posted on 2014-10-17
4
149 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

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

Workbook link problems after copying tabs to a new workbook? David Miller (dlmille) Intro Have you either copied sheets to a new workbook, and after having saved and opened that workbook, you find that there are links back to the original sou…
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

732 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