ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Dates (https://www.excelbanter.com/excel-worksheet-functions/163625-dates.html)

PAL

Dates
 
I have a date (any format, includes m/d/y) in one cell. In the cell next to
it, I just want the year to appear. Doesn't seem to be a format to allow
that. Please advise.

Billy Liddel

Dates
 
If the data is in A1 then in B1 you could type =Year(a1) or

in B1 type =A1, then choose Format, Cells, Number, Custom and in the Type
box type yyyy

The first method extracts the Year while the second retains the value and
changes the appearance of the date.

Peter

"PAL" wrote:

I have a date (any format, includes m/d/y) in one cell. In the cell next to
it, I just want the year to appear. Doesn't seem to be a format to allow
that. Please advise.


David Biddulph[_2_]

Dates
 
=A1 and format as YYYY, or =YEAR(A1), or =TEXT(A1,"YYYY").
The first leaves the full date in the cell, the second gives the number of
the year, and the third gives text.
--
David Biddulph

"PAL" wrote in message
...
I have a date (any format, includes m/d/y) in one cell. In the cell next
to
it, I just want the year to appear. Doesn't seem to be a format to allow
that. Please advise.




PAL

Dates
 
Thanks. In my array, I have several conditions, I want to select a specific
year from a the column with dates in a format (06-may-2006). Do I have to
put the date in the format you suggested or can the conditional in the array
search the whole date and pick out the 2006.

"Billy Liddel" wrote:

If the data is in A1 then in B1 you could type =Year(a1) or

in B1 type =A1, then choose Format, Cells, Number, Custom and in the Type
box type yyyy

The first method extracts the Year while the second retains the value and
changes the appearance of the date.

Peter

"PAL" wrote:

I have a date (any format, includes m/d/y) in one cell. In the cell next to
it, I just want the year to appear. Doesn't seem to be a format to allow
that. Please advise.



All times are GMT +1. The time now is 06:56 AM.

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