Date problem

  • Thread starter Thread starter JohnUk
  • Start date Start date
J

JohnUk

I am trying extract just the year from a date, ie
the cell would contain - 29/04/2004
Now if I go =Right(B2,4) in the hope I get - 2004, I end
up with the date code. How can I get around this? I have
tried all sorts, from pivots to pasting specials.
Many thanks in advance
John
Ps even if it needs some VBA, (but at a last resort)
 
Hi
try
=YEAR(A1)
an format the cell as 'Number' or if you want a text
string use
=TEXT(A1,"YYYY")
 
Many Thanks Frank
-----Original Message-----
Hi
try
=YEAR(A1)
an format the cell as 'Number' or if you want a text
string use
=TEXT(A1,"YYYY")

.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top