ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Question regarding dates (https://www.excelbanter.com/excel-worksheet-functions/191219-question-regarding-dates.html)

jimmy

Question regarding dates
 
I would like to know how I can denote the first day of the next month based
upon a date in another cell. For instance, if I had in cell A1 June 13, 2008
what is the formula I would write in cell A2 to show a value of July 1, 2008
by reference to A1?

Thanks,

Jimmy

Max

Question regarding dates
 
In A2: =DATE(YEAR(A1),MONTH(A1)+1,1)
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"Jimmy" wrote:
I would like to know how I can denote the first day of the next month based
upon a date in another cell. For instance, if I had in cell A1 June 13, 2008
what is the formula I would write in cell A2 to show a value of July 1, 2008
by reference to A1?

Thanks,

Jimmy


Ron Rosenfeld

Question regarding dates
 
On Fri, 13 Jun 2008 15:43:01 -0700, Jimmy
wrote:

I would like to know how I can denote the first day of the next month based
upon a date in another cell. For instance, if I had in cell A1 June 13, 2008
what is the formula I would write in cell A2 to show a value of July 1, 2008
by reference to A1?

Thanks,

Jimmy



A2: =A1+1-DAY(A1)

--ron

Rick Rothstein \(MVP - VB\)[_677_]

Question regarding dates
 
You went after the wrong month Ron.

Rick


"Ron Rosenfeld" wrote in message
...
On Fri, 13 Jun 2008 15:43:01 -0700, Jimmy

wrote:

I would like to know how I can denote the first day of the next month
based
upon a date in another cell. For instance, if I had in cell A1 June 13,
2008
what is the formula I would write in cell A2 to show a value of July 1,
2008
by reference to A1?

Thanks,

Jimmy



A2: =A1+1-DAY(A1)

--ron



Ron Rosenfeld

Question regarding dates
 
On Fri, 13 Jun 2008 20:25:41 -0400, "Rick Rothstein \(MVP - VB\)"
wrote:

You went after the wrong month Ron.

Rick


Funny what an adult beverage will do :-(

Should be

=A1-DAY(A1)+33-DAY(A1-DAY(A1)+32)

but now it's longer than the DATE function.

=DATE(YEAR(A1),MONTH(A1)+1,1)

<sigh



--ron

Spiky

Question regarding dates
 

Funny what an adult beverage will do :-(

Should be

=A1-DAY(A1)+33-DAY(A1-DAY(A1)+32)

but now it's longer than the DATE function.

=DATE(YEAR(A1),MONTH(A1)+1,1)

<sigh

--ron


If shorter is better, what about....
=EOMONTH(A1,0)+1

Ron Rosenfeld

Question regarding dates
 
On Mon, 16 Jun 2008 08:49:03 -0700 (PDT), Spiky
wrote:


Funny what an adult beverage will do :-(

Should be

=A1-DAY(A1)+33-DAY(A1-DAY(A1)+32)

but now it's longer than the DATE function.

=DATE(YEAR(A1),MONTH(A1)+1,1)

<sigh

--ron


If shorter is better, what about....
=EOMONTH(A1,0)+1


There are other parameters besides "shorter".

In pre-2007 versions, EOMONTH requires the Analysis Tool Pak to be installed.
Some IT departments don't do that, or allow it for all of their users. Also, if
that function is being used, then EVERY computer to which the spreadsheet is
distributed must have the ATP installed.

So unless you can guarantee that every computer will have the ATP installed, or
will be using Excel 2007+, it's probably better to avoid ATP functions.
--ron

Spiky

Question regarding dates
 
On Jun 16, 2:32 pm, Ron Rosenfeld wrote:
On Mon, 16 Jun 2008 08:49:03 -0700 (PDT), Spiky
wrote:





Funny what an adult beverage will do :-(


Should be


=A1-DAY(A1)+33-DAY(A1-DAY(A1)+32)


but now it's longer than the DATE function.


=DATE(YEAR(A1),MONTH(A1)+1,1)


<sigh


--ron


If shorter is better, what about....
=EOMONTH(A1,0)+1


There are other parameters besides "shorter".

In pre-2007 versions, EOMONTH requires the Analysis Tool Pak to be installed.
Some IT departments don't do that, or allow it for all of their users. Also, if
that function is being used, then EVERY computer to which the spreadsheet is
distributed must have the ATP installed.

So unless you can guarantee that every computer will have the ATP installed, or
will be using Excel 2007+, it's probably better to avoid ATP functions.
--ron


Hmpf. Any computer (or user) without all of the functions is
pointless. But I bow to the bureaucracy. I'm not here to change other
companies.


All times are GMT +1. The time now is 08:31 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com