Agreed, for some reason I missed the fact that we where talking about
timesheets.
I retract my post! Does not address the OP's need and is a bad idea to boot.
--
George Nicholson
Remove 'Junk' from return address.
"Biff" wrote in message
...
Hi!
I'm thinking the OP meant that 7 is the start time and 3 is the end time.
So, even if you reverse the order of your formula it still returns the
incorrect result. It returns either 4 or -4 when I'm pretty sure that the
correct answer should be 8.
Better for the OP to use 2 cells and real time values.
Biff
"George Nicholson" wrote in message
...
=VALUE(TRIM(LEFT(A2, FIND("-", A2,1)-1))) - VALUE(TRIM(MID(A2, FIND("-",
A2,1)+1, 5)))
This will only work if the separator is always "-".
As is, it assumes that the 2nd value in A2 will not be greater than 5
characters, including decimal (ie., a max of 99.99, or 999.9, etc.)
As long as the length of the 2nd value is 5 characters or less, it will
handle decimal values in either position.
HTH,
--
George Nicholson
Remove 'Junk' from return address.
"chefcasey"
wrote in message
...
I'm working on a work schedule. I would like to put two numbers that
represent time in a single cell and have them caculated to total the
amount of hours worked.
example:
7-3
--
chefcasey
------------------------------------------------------------------------
chefcasey's Profile:
http://www.excelforum.com/member.php...o&userid=27198
View this thread:
http://www.excelforum.com/showthread...hreadid=467241