+ Reply to Thread
Results 1 to 7 of 7

Convert Date to number?

  1. #1
    JethroUK©
    Guest

    Convert Date to number?

    How would i convert a date to number as a string

    e.g. 10/05/2005 > "20050510"

    note the month is 2 digit - 05

    i cant see Format(A1,"yyyy,mm,dd") & i tried = year(a1) & month(a1) &
    day(a1)

    but it returns month as single "2005510"



  2. #2
    JethroUK©
    Guest

    Re: Convert Date to number?

    p.s. i also tried cell formatting as yyyymmdd, then = "Hello" & A1 - but it
    doesn't import the format to a string


    "JethroUK©" <[email protected]> wrote in message
    news:[email protected]...
    > How would i convert a date to number as a string
    >
    > e.g. 10/05/2005 > "20050510"
    >
    > note the month is 2 digit - 05
    >
    > i cant see Format(A1,"yyyy,mm,dd") & i tried = year(a1) & month(a1) &
    > day(a1)
    >
    > but it returns month as single "2005510"
    >
    >




  3. #3
    Miguel Zapico
    Guest

    Re: Convert Date to number?

    You can try with TEXT, like this:
    =TEXT(A1,"yyyymmdd")

    Miguel.

    "JethroUK©" wrote:

    > p.s. i also tried cell formatting as yyyymmdd, then = "Hello" & A1 - but it
    > doesn't import the format to a string
    >
    >
    > "JethroUK©" <[email protected]> wrote in message
    > news:[email protected]...
    > > How would i convert a date to number as a string
    > >
    > > e.g. 10/05/2005 > "20050510"
    > >
    > > note the month is 2 digit - 05
    > >
    > > i cant see Format(A1,"yyyy,mm,dd") & i tried = year(a1) & month(a1) &
    > > day(a1)
    > >
    > > but it returns month as single "2005510"
    > >
    > >

    >
    >
    >


  4. #4
    Sandy Mann
    Guest

    Re: Convert Date to number?

    There may be better ways but:

    =TEXT(YEAR(E10),"####")&TEXT(MONTH(E10),"0#")&TEXT(DAY(E10),"0#")

    returns what you are looking for
    --
    HTH

    Sandy
    In Perth, the ancient capital of Scotland

    [email protected]
    [email protected] with @tiscali.co.uk


    "JethroUK©" <[email protected]> wrote in message
    news:[email protected]...
    > How would i convert a date to number as a string
    >
    > e.g. 10/05/2005 > "20050510"
    >
    > note the month is 2 digit - 05
    >
    > i cant see Format(A1,"yyyy,mm,dd") & i tried = year(a1) & month(a1) &
    > day(a1)
    >
    > but it returns month as single "2005510"
    >
    >




  5. #5
    Sandy Mann
    Guest

    Re: Convert Date to number?

    "Miguel Zapico" <[email protected]> wrote in message
    news:[email protected]...
    > You can try with TEXT, like this:
    > =TEXT(A1,"yyyymmdd")


    There I told you there may be better ways! <g>
    --

    Sandy
    In Perth, the ancient capital of Scotland

    [email protected]
    [email protected] with @tiscali.co.uk




  6. #6
    JethroUK©
    Guest

    Re: Convert Date to number?

    that's fine

    so how will i emmbed this in a string e.g.

    ="Bill" & TEXT(A1,"yyyymmdd") & "Ben"



    "Miguel Zapico" <[email protected]> wrote in message
    news:[email protected]...
    > You can try with TEXT, like this:
    > =TEXT(A1,"yyyymmdd")
    >
    > Miguel.
    >
    > "JethroUK©" wrote:
    >
    > > p.s. i also tried cell formatting as yyyymmdd, then = "Hello" & A1 - but

    it
    > > doesn't import the format to a string
    > >
    > >
    > > "JethroUK©" <[email protected]> wrote in message
    > > news:[email protected]...
    > > > How would i convert a date to number as a string
    > > >
    > > > e.g. 10/05/2005 > "20050510"
    > > >
    > > > note the month is 2 digit - 05
    > > >
    > > > i cant see Format(A1,"yyyy,mm,dd") & i tried = year(a1) & month(a1) &
    > > > day(a1)
    > > >
    > > > but it returns month as single "2005510"
    > > >
    > > >

    > >
    > >
    > >




  7. #7
    JethroUK©
    Guest

    Re: Convert Date to number?

    works fine - thanks


    "JethroUK©" <[email protected]> wrote in message
    news:[email protected]...
    > that's fine
    >
    > so how will i emmbed this in a string e.g.
    >
    > ="Bill" & TEXT(A1,"yyyymmdd") & "Ben"
    >
    >
    >
    > "Miguel Zapico" <[email protected]> wrote in message
    > news:[email protected]...
    > > You can try with TEXT, like this:
    > > =TEXT(A1,"yyyymmdd")
    > >
    > > Miguel.
    > >
    > > "JethroUK©" wrote:
    > >
    > > > p.s. i also tried cell formatting as yyyymmdd, then = "Hello" & A1 -

    but
    > it
    > > > doesn't import the format to a string
    > > >
    > > >
    > > > "JethroUK©" <[email protected]> wrote in message
    > > > news:[email protected]...
    > > > > How would i convert a date to number as a string
    > > > >
    > > > > e.g. 10/05/2005 > "20050510"
    > > > >
    > > > > note the month is 2 digit - 05
    > > > >
    > > > > i cant see Format(A1,"yyyy,mm,dd") & i tried = year(a1) & month(a1)

    &
    > > > > day(a1)
    > > > >
    > > > > but it returns month as single "2005510"
    > > > >
    > > > >
    > > >
    > > >
    > > >

    >
    >




+ 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