LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
nick
 
Posts: n/a
Default HELP with this code

Hi,

In worksheet 1 i have 3 fields:
A1 A2 A3
1234 1 19980101

A2 is a 3 character field, some with leading zeros and some without. A3 is
the date but i need to populate it as YYDDD. I need to populate all 3 fields
together in the following format:

123400198001

Someone suggested me i DO the following code and it worked perfect.

=IF(LEN(A2)=1,A1&"00"&A2&TEXT(A3,"yy")&IF(LEN(DAY( A3))=1,"00"&DAY(A3),"0"&DAY(A3)),IF(LEN(A2)=2,A1&" 0"&A2&TEXT(A3,"yy")&IF(LEN(DAY(A3))=1,"00"&DAY(A3) ,"0"&DAY(A3)),IF(LEN(A2)=3,A1&A2&TEXT(A3,"yy")&IF( LEN(DAY(A3))=1,"00"&DAY(A3),"0"&DAY(A3)))))

But i forgot to mention that if A1 has any leading zeros, they should be
removed and thats not included in the code, can someone suggest me? Thanks


 
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
code not unique find latest date Barbara Wiseman Excel Discussion (Misc queries) 3 December 11th 05 08:50 AM
VLOOKUP for Zip Code Ranges JerseyJR Excel Worksheet Functions 2 September 6th 05 06:37 PM
Conform a total to a list of results? xmaveric Excel Discussion (Misc queries) 1 August 21st 05 07:22 PM
Macro for changing text to Proper Case JPriest Excel Worksheet Functions 3 August 8th 05 09:31 PM
close form code tkaplan Excel Discussion (Misc queries) 1 June 3rd 05 10:49 PM


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