Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 69
Default Simple Excel Question?

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Simple Excel Question?

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)

"Jo" wrote in message
ups.com...
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


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Simple Excel Question Maurice Excel Discussion (Misc queries) 6 August 3rd 09 09:19 PM
IF formula-simple question; simple operator Rich D Excel Discussion (Misc queries) 4 December 6th 07 03:36 PM
very simple VBA question for Excel Giose Excel Programming 1 March 14th 07 06:51 PM
Simple Simple Excel usage question BookerW Excel Discussion (Misc queries) 1 June 23rd 05 10:06 PM
Simple Excel Question Justin Excel Programming 0 June 23rd 04 06:23 PM


All times are GMT +1. The time now is 01:49 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"