Solved

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

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

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

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

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

Drop Down List with Unique/Distinct Values (Part II - ComboBox or ListBox and Data Validation List Bonus!) David Miller (dlmille) Intro This article focuses on delivering unique, sorted lists to list objects (e.g., ComboBox, ListBox) and Dat…
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…
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

773 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