Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Rich Hayes
 
Posts: n/a
Default date format and the RIGHT function

In sheet 1 cell A1 i have a date that is generated from another sheet, the
date in this cell reads 'Jun-2005' (The cell is in mmm/yyyy format)

In cell B1 I have used the formula;

=DATE(YEAR(A1),MONTH(A1)+1,1)

This therefore returns the date 'Jul-2005' in cell B1.

I have continued this formula across row 1 for several columns.

In sheet 2 I have linked cells to those in sheet 1 as below;

cell A1 = 'Sheet1!A1 - this returns 'Jun-2005'
cell B1 = 'Sheet1!B1 - this returns 'Jul-2005'

Now in row 2 on sheet 2, i enter the following formulae and get the
following results.

cell A2 = right(A1,2) - this returns '05'
cell B2 = right(B1,2) - this returns '34'
cell C2 = right(C1,2) - this returns '65'

Is there any reason i get 34 returned for Jul 05 and 65 returned for Aug 05?
I need it to return '05'.

Any help you can be is very much appreciated,

Regards

Rich


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
SteveG
 
Posts: n/a
Default date format and the RIGHT function


Rich,

Your formula is returning the last two digits of the Excel serial
number for the date. July = 38534, Aug = 38565, Sept = 38596. Use
this instead.

=RIGHT(YEAR(C1),2)

HTH,

Cheers,

Steve


--
SteveG
------------------------------------------------------------------------
SteveG's Profile: http://www.excelforum.com/member.php...fo&userid=7571
View this thread: http://www.excelforum.com/showthread...hreadid=494553

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



All times are GMT +1. The time now is 07:26 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"