Simple Excel Question?

  • Thread starter Thread starter Jo
  • Start date Start date
J

Jo

Hi everone,

Say I have in one cell this: 1/2/2007 and I want to use function
Right(cell, 5) to extract the year only......

Instead, I get number like 39264?! How can I extract the year from
thing like 1/2/2007?

Thanks,
Mike
 
Jo,

The reason you get a number like 39264 is because that is how dates are
stored internally. A date is stored as the number of days since 0-Jan-1900.
1 = 1-Jan-1900, 2 = 2-Jan-1900, ... 39274 = 11-July-2007. When you take the
RIGHT of the cell, you are taking the right characters of the number of the
date serial number, not the formatted date in the cell. This will return a
number like the 39264 you encountered.

To get the year, use the YEAR function. E.g.,

=YEAR(A1)


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting
www.cpearson.com
(email on the web site)
 
Charles said:
=YEAR(cell)

Go to Cells/Format/Custom and use yyyyy. That will show you only the
year. You can scroll the custom box to see other variations.
 

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