+ Reply to Thread
Results 1 to 5 of 5

concatenating dates

Hybrid View

  1. #1
    Registered User
    Join Date
    04-05-2009
    Location
    Brisbane, Australia
    MS-Off Ver
    Office 365
    Posts
    71

    concatenating dates

    G'Day All,

    I have a date in cell A1 - lets say 26/07/2010.

    I have a formula in cell A2 that displays a string of text
    ="string "
    Then references cell A1
    & A1
    Then adds a hyphen for seperation
    & " - "
    Then adds 7 to the A1 (for an extra 7 days)
    & A1+7
    To which this is displayed;

    string 40385 - 40392

    ="string "& A1 & " - " & A1+7
    My question is; Can I display the integers as the dates they are, or am I restricted to integers?
    Last edited by Xtopher; 08-12-2010 at 11:48 PM.
    Regards,
    Xtopher

  2. #2
    Forum Expert Mordred's Avatar
    Join Date
    07-06-2010
    Location
    Winnipeg, Canada
    MS-Off Ver
    2007, 2010
    Posts
    2,787

    Re: concatenating dates

    I don't understand. Why not just do this:

    =A1+7
    If you're happy with someone's help, click that little star at the bottom left of their post to give them Reps.

    ---Keep on Coding in the Free World---

  3. #3
    Forum Expert Mordred's Avatar
    Join Date
    07-06-2010
    Location
    Winnipeg, Canada
    MS-Off Ver
    2007, 2010
    Posts
    2,787

    Re: concatenating dates

    If you want to have a string within the cell and the date you have to do something like this in VBA:

    Range("A1").Value = Date
    Range("A2").Value = "String" & "-" & Date

  4. #4
    Registered User
    Join Date
    04-05-2009
    Location
    Brisbane, Australia
    MS-Off Ver
    Office 365
    Posts
    71

    Re: concatenating dates

    I solved my own problem!!

    ="string" & TEXT(A1, "dd/mm/yyyy") & " - " & TEXT(A1+6, "dd/mm/yyyy")
    Thanks anyway

  5. #5
    Forum Expert Mordred's Avatar
    Join Date
    07-06-2010
    Location
    Winnipeg, Canada
    MS-Off Ver
    2007, 2010
    Posts
    2,787

    Re: concatenating dates

    Now I got ya!

+ 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