• Excel 2010 – date field leading space and serial value problems

    Home » Forums » AskWoody support » Productivity software by function » MS Excel and spreadsheet help » Excel 2010 – date field leading space and serial value problems

    Author
    Topic
    #505807

    Due to a bug in Crystal Reports, date fields export into Excel with a leading space in the cell.

    As on this occasion VBA is not any option, I attempted to remove the leading space with a formula that uses substitute, as follows:

    A1 = leading space + date (format yyyy-mm-dd)
    B1 = substitute (A1,” “,””)

    This removed the space, but displayed the field as a serial value, instead of the date in A1.

    I then tried:

    B1 = value(substitute(A1,” “,””))

    This formatted the field as a date, but left the leading space in the field.

    I would be very grateful for some help with this.

    useful 🙂

    Viewing 1 reply thread
    Author
    Replies
    • #1566509

      Hi

      This should do it:
      B1=TEXT(TRIM(A1),”yyyy-mm-dd”)

      zeddy

    • #1566511

      Hi Zeddy

      What can I say … you are a real genius! I am so grateful that you responded and did it so promptly!

      I only wish I could return the favour!

      Eternally grateful!

      useful 🙂 🙂

    Viewing 1 reply thread
    Reply To: Excel 2010 – date field leading space and serial value problems

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: