locked
date in excel RRS feed

  • Question

  • regards. I am developing a formula in the formula bar of Excel, but always to concatenate a cell with a date type value set another value, and I need to put the date

    ServiceFromDate="&"'"&Q29&"' "&","&"

    Tuesday, July 31, 2012 2:34 PM

Answers

  • Whenever you want to concatenate a date into a string, you need to format it using TEXT, like:

    ="Today is " & TEXT(TODAY(),"dddd mmmm dd, yyyy.")

    so

    ="ServiceFromDate=" & TEXT(Q29, "mm/dd/yyyy")

    (what you are creating the date from is unclear.... assuming that Q29 has a formula or date entered in it.


    HTH, Bernie

    Tuesday, July 31, 2012 3:34 PM

All replies

  • Whenever you want to concatenate a date into a string, you need to format it using TEXT, like:

    ="Today is " & TEXT(TODAY(),"dddd mmmm dd, yyyy.")

    so

    ="ServiceFromDate=" & TEXT(Q29, "mm/dd/yyyy")

    (what you are creating the date from is unclear.... assuming that Q29 has a formula or date entered in it.


    HTH, Bernie

    Tuesday, July 31, 2012 3:34 PM
  • ="XX " & TEXT(DATE(YEAR(Q29),MONTH(Q29),DAY(Q29)),"M/D/YY") &" YY"

    Tuesday, July 31, 2012 3:44 PM
  • Syswizard,

    Note that if Q29 has a value that YEAR, MONTH, and DAY will work with, there is no need to feed it into DATE, since it must be a DATE/TIME value. If it is text that looks like a date, then it may need DATEVALUE to create a valid date.

    Bernie


    HTH, Bernie

    Tuesday, July 31, 2012 4:11 PM