Dates

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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.
 
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
 
=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.
 
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.
 
Back
Top