Steve, first thing, this is not a very good way to keep track of time. It's
just full of potential bugs.
Try this:
=IF(A1="",0,IF(A1<1,A1*100,IF(A1>=12,INT(A1)*60+MOD(A1,1)*100,INT(A1+(A2="P")*12)*60+MOD(A1,1)*100)))
Things that I'm assuming since you didn't provide a thorough explanation of
what you want or what you're trying to do:
12:00 AM is entered as 0.00
12:01 AM to 12:59 AM is entered as a decimal value - 0.30 is 12:30 AM
1:00 AM to 11:59 AM is entered as a decimal value *AND* cell A2 is *EMPTY*:
A1 = 2.50
A2 = empty
So, A1 = 2:50 AM
12:00 PM to 11:59 PM is entered as a decimal value *AND* cell A2 *CONTAINS*
"P":
A1 = 10.20
A2 = P
So, A1 = 10:20 PM
The above formula will return a result in the range 0 to 1439. There are
1440 minutes in a day so 11:59 PM = 1439. After 11:59 PM the time rolls over
to 12:00 AM which starts a new day and thus has the value of 0.
I highly recommend that you NOT use this method of timekeeping.
Biff