hjh93
hjh93

Reputation: 570

Excel - Formula to join 2 cells into one, but one is in date format

In my Excel there are 2 columns with data values. One have date and another have a string of numbers.

| 2019-01-25 | 114589 |

In the next column, I have a formula which will join the 2 together.

Formula:
    =C2&", "&D2

What I expected:
| 2019-01-25, 114589 |

What I got:
| 43490, 114589 |

This formula worked fine if both columns were using text and numbers. But now that date is involved, it cannot work and the date reverts to number format, even when the cell format is set to date. How to tell the cell to give me my data as a string?

Upvotes: 0

Views: 138

Answers (2)

JvdV
JvdV

Reputation: 75840

Try:

=TEXT(C2,"yyyy-mm-dd, ")&D2

Upvotes: 2

Error 1004
Error 1004

Reputation: 8220

You could try:

=TEXT(C2,"yyyy-mm-dd") & " " & D2

Upvotes: 1

Related Questions