Search code examples
excelfunctionformula

I'm using concatenate function in excel but result is "true" and "false", why?


I'm trying to convert date and time to text but when I use this formula

=concatenate(text(A2,"yyyy-mm-dd")&" "&text(B2,"hh:mm:ss"))

the result is "true" and "false" enter image description here

I tried to look my old file, and the result should look like this
enter image description here


Solution

  • Why are you even doing this?
    In Excel, dates are stored as integers, while times are stored as decimals. As both are numbers, you can get a datetime (date AND time) by simply adding both values.

    So, this formula should give you what you need:

    =TEXT(A2+B2,"yyyy-mm-dd hh:mm:ss")
    

    Result:

    enter image description here