View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Peo Sjoblom
 
Posts: n/a
Default Date Calc in hours

Use excel time format and just subtract, if this is some sort of import and
there are never more than 24 hours difference you can use

=MOD(TEXT(MID(B1,FIND(" ",B1)+1,255),"00\:00")-TEXT(MID(A1,FIND("
",A1)+1,255),"00\:00"),1)

if more than 24 hours you would need to use the dates as well, more ugly
looking

=(LEFT(B1,FIND(" ",B1)-1)+TEXT(MID(B1,FIND("
",B1)+1,255),"00\:00"))-(LEFT(A1,FIND(" ",A1)-1)+TEXT(MID(A1,FIND("
",A1)+1,255),"00\:00"))

format as time will return 4:00

--

Regards,

Peo Sjoblom

Northwest Excel Solutions

www.nwexcelsolutions.com

(remove ^^ from email address)

Portland, Oregon




"MWH" wrote in message
...
I'm trying to perform a date calc to produce a variance in hours
ex cell A1 3/27/2006 2100, cell B1 3/28/2006 0100, cell C1 =b1-a1, results
I would like to see is 4
This spreadsheet will be used for scheduling so both positive and negative
numbers will be used for variance numbers.


--
Mark W. Hanford