Ron thanks for your reply, I require it to be written as
11.25, in A1 and 1.25 in B1. 11.25 is AM and 1.25 is PM.
I am producing a spreadsheet with this type of time
format for my company as when you type in a few times per
day for a timetable it is quicker, I would for example
put a formula that tells cell A1 to replace . (Decimal)
with : but I am only learning to do functions, and I
would not know if this is possible
Note that if you replace the decimal with a colon, you will be dealing with
Excel times and, if you want a decimal result, you will have to multiply your
answer by 24. Excel stores times as fractions of a day, so you still need some
rule to tell AM from PM. If the rule is that a time in A1 is AM and a time in
B1 is PM, then
=dollarde(B1+12,60)-dollarde(A1,60)
will give you a result of 2
If you want to convert to Excel times, then you could use:
=(TIMEVALUE(SUBSTITUTE(B1+12,".",":"))-TIMEVALUE(SUBSTITUTE(A1,".",":")))*24
which would result in a value of 2.
or if you don't have the analysis toolpak installed, you could use:
=B1+12+MOD(B1,1)/0.6-(A1+MOD(A1,1)/0.6)
But you do need to be clear about differentiating AM from PM. And also whether
you want the result to be in Decimal or in the Excel time format.
--ron