View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.misc
David Biddulph[_2_] David Biddulph[_2_] is offline
external usenet poster
 
Posts: 8,651
Default Combining AM and time

But is the 9:21:00 AM text, or is it a time formatted that way? What do
=ISTEXT(H2) and =ISNUMBER(H2) show?
What happens if you use Format/ Cells, and change to a different time
format, such as hh:mm? Does it change to 09:21 ? Does my formula work?
--
David Biddulph

"Jon M" wrote in message
...
Okay.
After looking at it moire closely, their data is even more screwed up.
Actual cell content is:


H2: "9:21:00 AM"
I2: "PM"

With the intent being to indicate 21:21 hrs.

Thanks in advance for any help.



"David Biddulph" wrote:

That's OK if the 12:58 is text, but not if it is a real time.
=--(G1&" "&H1) will do the same.

To cope with either text or time, try
=TIMEVALUE(TEXT(G1,"hh:mm")&" "&H1) or
=--(TEXT(G1,"hh:mm")&" "&H1)
--
David Biddulph

"BobT" wrote in message
...
Use the TimeValue function. Your formula would be something like this

=TimeValue(G1&" "&H1)

Then format this cell as Time. You need the &" "& to put a space
between
the minutes and the AM/PM bit.

"Jon M" wrote:

Recently received data from another department in Excel spreadsheet.
Unfortunately, time data is split into two cells, i.e., G1= 12:58 and
H1=
AM.

What is the easiest way to combine them into time format for logical
operations?

Thanks in advance for any help!