Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11
Default Rounding date field up to next first of month, with existing formu

I have a spreadsheet that has the following 4 columns.

Term End Date Evg Term Days Notice Next Avail Termination Date

The column "Next Avail Termination Date" has a formula that has the current
logic applied:

If Todays Date is greater than the Term End Date minus the Days Notice, and
the Evg Term = MO, then the Next Avail Termination Date = Today plus Days
Notice. This is working fine with this formula:

=IF(AND(TODAY()A2-C2,B2="mo"),TODAY()+C2)

However, I need to add one more piece of formula, and I can't quite figure
out how. I need it to add logic, that if the date returned from the current
formula above is any day other than the first of the month, that it will
round to the first of the next month. For instance, using the formula above,
it's currently returning the date "02/12/10", and I need it to instead return
"03/01/10".

Any help is greatly appreciated. Thanks!
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11
Default Rounding date field up to next first of month, with existing formu



"Stacie2410" wrote:

I have a spreadsheet that has the following 4 columns.

Term End Date Evg Term Days Notice Next Avail Termination Date

The column "Next Avail Termination Date" has a formula that has the current
logic applied:

If Todays Date is greater than the Term End Date minus the Days Notice, and
the Evg Term = MO, then the Next Avail Termination Date = Today plus Days
Notice. This is working fine with this formula:

=IF(AND(TODAY()A2-C2,B2="mo"),TODAY()+C2)

However, I need to add one more piece of formula, and I can't quite figure
out how. I need it to add logic, that if the date returned from the current
formula above is any day other than the first of the month, that it will
round to the first of the next month. For instance, using the formula above,
it's currently returning the date "02/12/10", and I need it to instead return
"03/01/10".

Any help is greatly appreciated. Thanks!


My apologies, the columns didn't show up quite right, they a

Column A: Term End Date
Column B: Evg Term
Column C: Days Notice
Column D: Next Avail Termination Date
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 510
Default Rounding date field up to next first of month, with existing formu

Hi

=IF(AND(TODAY()A2-C2,B2="mo"),DATE(YEAR(TODAY()+C2-1),MONTH(TODAY()+C2-1)+1,1))


Arvi Laanemets


"Stacie2410" wrote in message
...
I have a spreadsheet that has the following 4 columns.

Term End Date Evg Term Days Notice Next Avail Termination Date

The column "Next Avail Termination Date" has a formula that has the
current
logic applied:

If Todays Date is greater than the Term End Date minus the Days Notice,
and
the Evg Term = MO, then the Next Avail Termination Date = Today plus Days
Notice. This is working fine with this formula:

=IF(AND(TODAY()A2-C2,B2="mo"),TODAY()+C2)

However, I need to add one more piece of formula, and I can't quite figure
out how. I need it to add logic, that if the date returned from the
current
formula above is any day other than the first of the month, that it will
round to the first of the next month. For instance, using the formula
above,
it's currently returning the date "02/12/10", and I need it to instead
return
"03/01/10".

Any help is greatly appreciated. Thanks!



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,836
Default Rounding date field up to next first of month, with existing f

Maybe this:
=IF(AND(TODAY()A2-C2,B2="mo"),DATE(YEAR(A2),MONTH(A2),1),DATE(YEAR(A 2),MONTH(A2)+1,1))

Does that help?

--
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.


"Stacie2410" wrote:



"Stacie2410" wrote:

I have a spreadsheet that has the following 4 columns.

Term End Date Evg Term Days Notice Next Avail Termination Date

The column "Next Avail Termination Date" has a formula that has the current
logic applied:

If Todays Date is greater than the Term End Date minus the Days Notice, and
the Evg Term = MO, then the Next Avail Termination Date = Today plus Days
Notice. This is working fine with this formula:

=IF(AND(TODAY()A2-C2,B2="mo"),TODAY()+C2)

However, I need to add one more piece of formula, and I can't quite figure
out how. I need it to add logic, that if the date returned from the current
formula above is any day other than the first of the month, that it will
round to the first of the next month. For instance, using the formula above,
it's currently returning the date "02/12/10", and I need it to instead return
"03/01/10".

Any help is greatly appreciated. Thanks!


My apologies, the columns didn't show up quite right, they a

Column A: Term End Date
Column B: Evg Term
Column C: Days Notice
Column D: Next Avail Termination Date

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 38
Default Rounding date field up to next first of month, with existingformu

Just think what you have to do. One way is . . .

If DAY(MyDate) = 1 then MyDate, else MyDate = DATE(YEAR(MyDate), MONTH
(MyDate) + 1, 1).

But of course December (where one has to increment year) have to be
dealt with.

But EOMONTH() function gives the date of the last day of a month, so
add one to that date.

=IF(DAY(MyDate)=1, MyDate, EOMONTH(MyDate, 1)+1)

MyDate is, of course, the date you have calculated previously.

Look up EOMONTH() in Excel Help. Also look up EDATE() function & other
date functions.

Alan Lloyd


  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,651
Default Rounding date field up to next first of month, with existing formu

On Wed, 13 Jan 2010 20:45:01 -0800, Stacie2410
wrote:

I have a spreadsheet that has the following 4 columns.

Term End Date Evg Term Days Notice Next Avail Termination Date

The column "Next Avail Termination Date" has a formula that has the current
logic applied:

If Todays Date is greater than the Term End Date minus the Days Notice, and
the Evg Term = MO, then the Next Avail Termination Date = Today plus Days
Notice. This is working fine with this formula:

=IF(AND(TODAY()A2-C2,B2="mo"),TODAY()+C2)

However, I need to add one more piece of formula, and I can't quite figure
out how. I need it to add logic, that if the date returned from the current
formula above is any day other than the first of the month, that it will
round to the first of the next month. For instance, using the formula above,
it's currently returning the date "02/12/10", and I need it to instead return
"03/01/10".

Any help is greatly appreciated. Thanks!


Subtract 1 from the calculated date
Go to end of month
Add 1

So modifying your formula:

=IF(AND(TODAY()A2-C2,B2="mo"),EOMONTH(TODAY()+C2-1,0)+1)

If you have Excel prior to 2007, you will need to ensure the Analysis ToolPak
is installed. See HELP for the EOMONTH function if this formula returns a
#NAME error.
--ron
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
Parsing Out a Month from a date field Warm FL Excel Discussion (Misc queries) 3 January 7th 10 08:29 PM
Formula to add 12 months to an existing date field Steve 084[_2_] Excel Discussion (Misc queries) 3 January 14th 09 08:58 PM
Rounding a date up to the 1st of the next month hurds999 Excel Worksheet Functions 4 April 3rd 08 05:40 PM
Converting a date field into a month-year only field C.Hirsch Excel Discussion (Misc queries) 1 April 25th 06 12:08 AM
Calculate 1st of month date from existing date. Jim15 Excel Discussion (Misc queries) 1 January 9th 06 10:05 PM


All times are GMT +1. The time now is 05:01 AM.

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"