I have 2 cells that contain times. one has, for example, 1:00 pm and one has 8:00 pm. I am trying to concatenate them into one cell looking like this 1:00 pm - 8:00pm. I cannot seem to get this to give the desired results. Any help is appreciated.
Assuming that your two cells are A1 & B1...
[tt]
=TEXT(A1,"[highlight #8AE234]hh:mm am/pm[/highlight][highlight #8AE234][/highlight]")&" - "&TEXT(B1,"hh:mm am/pm")
[/tt]
The reason for converting Time Values to TEXT is because time is a fractional number.
1:00 PM is 13/24 = 0.541666666666667. That is the actual value in your cell. What you see displayed is a [highlight #8AE234]Number Format[/highlight] for Time in your cell. If you were to change the Number Format to GENERAL, you would see tha actual value. Changing a Number Format does nothing to the actual value in the cell. It just changes what you see displayed in the cell.
Bottom line, you need the NUMBER displayed as a TEXT string in TIME FORMAT in order to be able concatenate with other TEXT values.
Skip,
[sub]
Just traded in my OLD subtlety...
for a NUance![/sub]
"The most incomprehensible thing about the universe is that it is comprehensible" A. Einstein
Unless your "2 cells that contain times" actually contain text that you interpret as time. In which case your formula would be simply:[tt]
=A1&" - "&B1 [/tt]
Well it would have helped had the OP stated...
[ul]
[li]the formula the OP had used and[/li]
[li]the results the OP had observed.[/li]
[/ul]
Skip,
[sub]
Just traded in my OLD subtlety...
for a NUance![/sub]
"The most incomprehensible thing about the universe is that it is comprehensible" A. Einstein
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.