View Single Post
  #5   Report Post  
George Nicholson
 
Posts: n/a
Default

=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