ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Date function (https://www.excelbanter.com/excel-discussion-misc-queries/125339-date-function.html)

JohnU

Date function
 
I am using the NOW() function to insert the current date. This works fine,
except I am attempting to extract only the year (i.e. 2007) from this
function.

The problem is that Excel expresses the value of the date as a number (x
number of days from January 1, 1900). I can get the format to display the
date in an mm/dd/yyyy format, I just can not extract the year all alone. I
need to get the year by itself for another calculation.

Any ideas?

Dave F

Date function
 
=YEAR(TODAY())

Format as date, not number.

Dave
--
Brevity is the soul of wit.


"JohnU" wrote:

I am using the NOW() function to insert the current date. This works fine,
except I am attempting to extract only the year (i.e. 2007) from this
function.

The problem is that Excel expresses the value of the date as a number (x
number of days from January 1, 1900). I can get the format to display the
date in an mm/dd/yyyy format, I just can not extract the year all alone. I
need to get the year by itself for another calculation.

Any ideas?


Roger Govier

Date function
 
Hi John

=YEAR(NOW())
or with
=NOW() entered into a cell, FormatCellsNumberCustom yyyy

Remember NOW() is volatile and your value will alter next year.

If you want to enter the fixed Date into a cell use Control + semicolon
(CTRL+;)
Again format the cell to just show yyyy
--
Regards

Roger Govier


"JohnU" wrote in message
...
I am using the NOW() function to insert the current date. This works
fine,
except I am attempting to extract only the year (i.e. 2007) from this
function.

The problem is that Excel expresses the value of the date as a number
(x
number of days from January 1, 1900). I can get the format to display
the
date in an mm/dd/yyyy format, I just can not extract the year all
alone. I
need to get the year by itself for another calculation.

Any ideas?




Gord Dibben

Date function
 
John

In a helper cell enter =YEAR(cellref)


Gord Dibben MS Excel MVP

On Tue, 9 Jan 2007 08:22:00 -0800, JohnU
wrote:

I am using the NOW() function to insert the current date. This works fine,
except I am attempting to extract only the year (i.e. 2007) from this
function.

The problem is that Excel expresses the value of the date as a number (x
number of days from January 1, 1900). I can get the format to display the
date in an mm/dd/yyyy format, I just can not extract the year all alone. I
need to get the year by itself for another calculation.

Any ideas?



David Biddulph

Date function
 
Are you sure you want to format that as date, Dave?
=YEAR(TODAY()) formatted as date will give you 29th June 1905. I would
prefer to see it formatted as General or Number.
--
David Biddulph

"Dave F" wrote in message
...
=YEAR(TODAY())

Format as date, not number.

Dave


"JohnU" wrote:

I am using the NOW() function to insert the current date. This works
fine,
except I am attempting to extract only the year (i.e. 2007) from this
function.

The problem is that Excel expresses the value of the date as a number (x
number of days from January 1, 1900). I can get the format to display
the
date in an mm/dd/yyyy format, I just can not extract the year all alone.
I
need to get the year by itself for another calculation.

Any ideas?




Dave F

Date function
 
No, you're right. Should be formatted as general or number.
--
Brevity is the soul of wit.


"David Biddulph" wrote:

Are you sure you want to format that as date, Dave?
=YEAR(TODAY()) formatted as date will give you 29th June 1905. I would
prefer to see it formatted as General or Number.
--
David Biddulph

"Dave F" wrote in message
...
=YEAR(TODAY())

Format as date, not number.

Dave


"JohnU" wrote:

I am using the NOW() function to insert the current date. This works
fine,
except I am attempting to extract only the year (i.e. 2007) from this
function.

The problem is that Excel expresses the value of the date as a number (x
number of days from January 1, 1900). I can get the format to display
the
date in an mm/dd/yyyy format, I just can not extract the year all alone.
I
need to get the year by itself for another calculation.

Any ideas?






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

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