+ Reply to Thread
Results 1 to 5 of 5

Concatenate error??

  1. #1
    Registered User
    Join Date
    01-04-2012
    Location
    Wales
    MS-Off Ver
    Excel 2007
    Posts
    8

    Concatenate error??

    Hi all,

    I have something which is driving me crazy, I am trying to add a week number to a year number.
    I need the result to always contain the same numnber of characters.
    My week numbers are 1-52 and years 2012,2013 etc..
    I custom format the week number cell so I always get two digits, 1 becomes 01. and then concatenate year number,weeknumber.
    The concatenate works but excel strips the leading zero from the week number so instead of 201201, I get 20121....Arrrgghgghhhh!!

    anyone know why or how to solve?

    Thanks

    Mike
    Last edited by mikecymru; 01-09-2012 at 08:40 AM.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,510

    Re: Concatenate error??

    =TEXT(A1,"0000")&TEXT(B1,"00")


    Regards, TMS


    Edited: year and week number wrong way round
    Last edited by TMS; 01-09-2012 at 08:03 AM. Reason: Formula correction
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,453

    Re: Concatenate error??

    Perhaps something like =A1&text(A2,"00") where A1 contains year and A2 the week nr

  4. #4
    Registered User
    Join Date
    01-04-2012
    Location
    Wales
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: [Solved]Concatenate error??

    Perfect, Thank you both.

    They both are perfectly acceptable..

    thanks

    Mike
    Last edited by mikecymru; 01-09-2012 at 08:39 AM. Reason: solved

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,510

    Re: Concatenate error??

    You're welcome. Regards, TMS

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1