Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 56
Default Extract Year Only

Hi,

I found a post that gave year function (=year(cell)) to extract only the
year from a date. I have 1/15/2006 and I get 6/28/1905. This date was
exported from Access into an Excel spreadsheet. I'm not sure if that would
have an effect on it, but thought I would include it in message. If I
format the new column to a number, I get 38722. I know Access uses numbers
for dates, so I need to somehow convert to get correct year.

Can anyone help me get 2006 from 1/15/2006?

Thanks in advance for any help,
Pam


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35,218
Default Extract Year Only

Make sure you format the cell with the =year() formula as General.

Right now you have it formatted as a date.

Pam wrote:

Hi,

I found a post that gave year function (=year(cell)) to extract only the
year from a date. I have 1/15/2006 and I get 6/28/1905. This date was
exported from Access into an Excel spreadsheet. I'm not sure if that would
have an effect on it, but thought I would include it in message. If I
format the new column to a number, I get 38722. I know Access uses numbers
for dates, so I need to somehow convert to get correct year.

Can anyone help me get 2006 from 1/15/2006?

Thanks in advance for any help,
Pam


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default Extract Year Only

Hi

with your date in a1
put this in b1
=A1 and a custom format of yyyy


Mike

"Pam" wrote:

Hi,

I found a post that gave year function (=year(cell)) to extract only the
year from a date. I have 1/15/2006 and I get 6/28/1905. This date was
exported from Access into an Excel spreadsheet. I'm not sure if that would
have an effect on it, but thought I would include it in message. If I
format the new column to a number, I get 38722. I know Access uses numbers
for dates, so I need to somehow convert to get correct year.

Can anyone help me get 2006 from 1/15/2006?

Thanks in advance for any help,
Pam



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 56
Default Extract Year Only

I don't know what I was doing wrong, but I thought yyyy would work and it
didn't, but entered exactly as you have and it did.
Thanks for the quick reply and helpful answer.

"Mike H" wrote in message
...
Hi

with your date in a1
put this in b1
=A1 and a custom format of yyyy


Mike

"Pam" wrote:

Hi,

I found a post that gave year function (=year(cell)) to extract only the
year from a date. I have 1/15/2006 and I get 6/28/1905. This date was
exported from Access into an Excel spreadsheet. I'm not sure if that
would
have an effect on it, but thought I would include it in message. If I
format the new column to a number, I get 38722. I know Access uses
numbers
for dates, so I need to somehow convert to get correct year.

Can anyone help me get 2006 from 1/15/2006?

Thanks in advance for any help,
Pam





  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 56
Default Extract Year Only

Thank you for your quick reply and helpful answer.
"Dave Peterson" wrote in message
...
Make sure you format the cell with the =year() formula as General.

Right now you have it formatted as a date.

Pam wrote:

Hi,

I found a post that gave year function (=year(cell)) to extract only the
year from a date. I have 1/15/2006 and I get 6/28/1905. This date was
exported from Access into an Excel spreadsheet. I'm not sure if that
would
have an effect on it, but thought I would include it in message. If I
format the new column to a number, I get 38722. I know Access uses
numbers
for dates, so I need to somehow convert to get correct year.

Can anyone help me get 2006 from 1/15/2006?

Thanks in advance for any help,
Pam


--

Dave Peterson





  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 7,247
Default Extract Year Only

Dates in Excel are stored as the number of days since 0-Jan-1900 (1 =
1-Jan-1900 through 39738 = 17-Oct-2008 and so on). When you use YEAR,
you return to the cell the year as an integer, say 2006. If you format
that cell as a date, Excel treats the value as a serial date, and 2006
days since 0-Jan-1900 is 28-June-1905. You need to format that cells
as General or numeric, not as a date.

Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)


On Fri, 17 Oct 2008 16:20:41 -0500, "Pam"
wrote:

Hi,

I found a post that gave year function (=year(cell)) to extract only the
year from a date. I have 1/15/2006 and I get 6/28/1905. This date was
exported from Access into an Excel spreadsheet. I'm not sure if that would
have an effect on it, but thought I would include it in message. If I
format the new column to a number, I get 38722. I know Access uses numbers
for dates, so I need to somehow convert to get correct year.

Can anyone help me get 2006 from 1/15/2006?

Thanks in advance for any help,
Pam

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
Combination Graph with current year and prior year sales JanW Charts and Charting in Excel 2 April 5th 07 09:20 PM
extract year from the date in a cell DKY Excel Worksheet Functions 7 March 17th 06 07:07 PM
extract year maryj Excel Worksheet Functions 5 November 11th 05 02:36 PM
Extract Unique Values, Then Extract Again to Remove Suffixes Karl Burrows Excel Discussion (Misc queries) 23 June 25th 05 10:37 PM
How to compare current year to prior year in bar chart? substring Charts and Charting in Excel 4 May 12th 05 07:04 PM


All times are GMT +1. The time now is 06:40 PM.

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

About Us

"It's about Microsoft Excel"