how do i subtract date and time into hours and convert hours to decimal in excel

%3CLINGO-SUB%20id%3D%22lingo-sub-1263653%22%20slang%3D%22en-US%22%3Ehow%20do%20i%20subtract%20date%20and%20time%20into%20hours%20and%20convert%20hours%20to%20decimal%20in%20excel%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1263653%22%20slang%3D%22en-US%22%3E%3CP%3EI%20am%20trying%20to%20subtract%20cells%20that%20contain%20a%20date%20and%20time%20from%20another%20cell%26nbsp%3Bthat%20contain%20a%20date%20and%20time%20into%20hours%20and%20then%20convert%20that%20to%20a%20decimal.%20E.g.%26nbsp%3B18%2F10%2F2018%204%3A53%3A50%20AM%20minus%2017%2F10%2F2018%205%3A12%3A30%20PM%20equals%20(hours%20as%20a%20decimal%20number).%20Anyone%20any%20ideas%20how%20I%20can%20reliably%20do%20this%3F%20Thanks%20in%20advance.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1263653%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMacros%20and%20VBA%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1263660%22%20slang%3D%22en-US%22%3ERe%3A%20how%20do%20i%20subtract%20date%20and%20time%20into%20hours%20and%20convert%20hours%20to%20decimal%20in%20excel%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1263660%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F600450%22%20target%3D%22_blank%22%3E%40LesPink%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThat's%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3E%3D(C3-B3)*24%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3EIn%20Excel%201%20Hour%20is%20equal%20to%201%2F24.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
New Contributor

I am trying to subtract cells that contain a date and time from another cell that contain a date and time into hours and then convert that to a decimal. E.g. 18/10/2018 4:53:50 AM minus 17/10/2018 5:12:30 PM equals (hours as a decimal number). Anyone any ideas how I can reliably do this? Thanks in advance.

3 Replies
Highlighted

@LesPink 

That's 

=(C3-B3)*24

In Excel 1 Hour is equal to 1/24.

Highlighted

@Sergei Baklan 

Thanks Sergei. I tried that and it didnt seem to be working, but you are correct. Appreciate you taking the time to help. Les

Highlighted

@LesPink , did you check the file I attached to previous post?