Tuesday, September 14, 2010

Excel - Concatenating dates with strings will result wrong value -WorkAround is use Text()

Open any excel -> Enter some date(let us say 12/07/2009) in the cell A1.
And add the following formula in B1
="Date ref: " &A$1   -> It gives the date value in a long format i.e Date ref:: 40154

Work Around

Use Text() function to format the date.

="Date ref: " &TEXT(A$1,"MM/dd/yyyy") -> It gives the date value as we expected ie. Date ref: 12/07/2009

No comments:

Post a Comment