• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

How to format date in vba

ThrottleWorks

Excel Ninja
Cell A1 value is today’s date in dd mmm yyyy format (08 Jan 2013)

Cell A2 value is Data_

I want to concatenate in following manner


Data_08 Jan 2013


But excel is giving me Data_41282

I am using following formula to concat, =a2&a1


Can anyone help me in this please
 
Since you're converting a numerical value (date) into text, need to use the TEXT function like this:

=A2*TEXT(A2,"dd mmm yyyy")
 
Sir thanks a lot for the help but this is giving me different result.


1704203524


=M3*TEXT(M3,"dd mmm yyyy")


I have populated date using today formula in cell m3 to recheck the results.


Kindly help.
 
Oops, my apologies. It should be an ampersand, not asterisk, and the function should reference A1, not A2. Man...need to get some coffee I guess. <embarassed>

=A2&TEXT(A1,"dd mmm yyyy")
 
Back
Top