Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Adding to Dates

I'm creating a benefits spreadsheet to help with health insurance eligibility
and COBRA notifications.

I want to write a formula that will look at the start date entered, add 90
days to it and then return a date that is the first day of the first month
following.

So if a date of 4/15/04 was entered, the formula would return 8/1/04.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 694
Default Adding to Dates

Hi,
Say the date is in A1
In another cell, use the formula:
=DATE(YEAR(A1+90),MONTH(A1+90)+1,1)
- A1+90 returns the date 90 days later
- DATE( year(@), Month(@)+1, 1) returns the date 1 month later and the 1st
of that month.

Regards,
Sebastien

"turboalto" wrote:

I'm creating a benefits spreadsheet to help with health insurance eligibility
and COBRA notifications.

I want to write a formula that will look at the start date entered, add 90
days to it and then return a date that is the first day of the first month
following.

So if a date of 4/15/04 was entered, the formula would return 8/1/04.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,089
Default Adding to Dates

Try this:

=DATE(YEAR(A5+90),MONTH(A5+90)+1,1)

assuming the start date is in cell A5

Regards

Trevor


"turboalto" wrote in message
...
I'm creating a benefits spreadsheet to help with health insurance

eligibility
and COBRA notifications.

I want to write a formula that will look at the start date entered, add 90
days to it and then return a date that is the first day of the first month
following.

So if a date of 4/15/04 was entered, the formula would return 8/1/04.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Adding to Dates

Sub DDD()
Dim dt As Date, dt1 As Date
Dim dt2 As Date

For Each cell In Range("A1:A365")
cell.Value = DateValue("01/01/2004") + cell.row - 1
dt = cell.Value

dt1 = dt + 90
If Day(dt1) < 1 Then
dt2 = DateSerial(Year(dt1), Month(dt1) + 1, 1)
Else
dt2 = dt1
End If
cell.Offset(0, 1).Value = dt2
Next
Range("C1:C365").Formula = "=B1-A1"
End Sub

a formula would be

=Date(year(A1+90),Month(A1+90)+1,1)

A question is what happends if date + 90 is on the first of a month?

--
Regards,
Tom Ogilvy




"turboalto" wrote in message
...
I'm creating a benefits spreadsheet to help with health insurance

eligibility
and COBRA notifications.

I want to write a formula that will look at the start date entered, add 90
days to it and then return a date that is the first day of the first month
following.

So if a date of 4/15/04 was entered, the formula would return 8/1/04.



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 863
Default Adding to Dates

With the start date in A1:

=IF(DAY(A1+90)=1,A1+90,DATE(YEAR(A1+90),MONTH(A1+9 0)+1,1))

Note that with a start date of 1/2/2004, adding 90 days takes you to 4/1/2004.
The above formula returns 4/1/2004 rather than 5/1/2004. If the interval must
be at least 91 days, both of the following formulas return 5/1

=IF(DAY(A1+91)=1,A1+91,DATE(YEAR(A1+91),MONTH(A1+9 1)+1,1))
=DATE(YEAR(A1+90),MONTH(A1+90)+1,1)

I tried all 3 formulas with dates from 1/1/2004 through 12/31/2004. The only
differences involved cases where (StartDate + 90) falls on the 1st of a month.

On Thu, 30 Sep 2004 10:49:04 -0700, turboalto
wrote:

I'm creating a benefits spreadsheet to help with health insurance eligibility
and COBRA notifications.

I want to write a formula that will look at the start date entered, add 90
days to it and then return a date that is the first day of the first month
following.

So if a date of 4/15/04 was entered, the formula would return 8/1/04.




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding dates in columns Roy Excel Worksheet Functions 2 April 12th 10 03:25 AM
adding differences between dates RobertK Excel Discussion (Misc queries) 6 September 18th 09 06:40 PM
Adding up dates Al B Excel Discussion (Misc queries) 1 January 20th 06 03:13 AM
Adding dates and times DejaVu Excel Discussion (Misc queries) 4 October 26th 05 03:32 PM
Adding dates Natalie Excel Worksheet Functions 1 March 18th 05 09:54 AM


All times are GMT +1. The time now is 03:03 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"