SOLVED

help

%3CLINGO-SUB%20id%3D%22lingo-sub-2831423%22%20slang%3D%22en-US%22%3Ehelp%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2831423%22%20slang%3D%22en-US%22%3E%3CP%3EI%20want%20to%20know%20if%20it%C2%B4s%20possible%20to%20calculate%20%3CEM%3E(to%20subtract%2C%20in%20fact)%3C%2FEM%3E%20two%20different%20hours%20%3CEM%3E(Arrival%20and%20departure)%3C%2FEM%3E%20in%20the%20same%20cell%2C%20and%20then%20sum%20up%20this%20with%20others%20cells%20from%20other%20days.%20I%20don%C2%B4t%20know%20if%20you%20guys%20understand%20what%20I%20mean.%3C%2FP%3E%3CP%3EThis%20is%20the%20example%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EMonday%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3BTuesday%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3BWednesday%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20total%20hours%3C%2FP%3E%3CP%3E13%3A00%20-%2018%3A30%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B11%3A00%20-%2020%3A30%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B15%3A00%20-%200%3A00%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%3F%3F%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%20in%20advance!!!!%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2831423%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ETraining%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2831480%22%20slang%3D%22en-US%22%3ERe%3A%20help%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2831480%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1181214%22%20target%3D%22_blank%22%3E%40JuanAros%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ELet's%20say%20the%20times%20are%20in%20A2%3AC2.%3C%2FP%3E%0A%3CP%3EEnter%20the%20following%20formula%20in%20D2.%20If%20you%20are%20NOT%20using%20Excel%20in%20Microsoft%20365%20or%20Excel%202021%2C%20confirm%20the%20formula%20with%20Ctrl%2BShift%2BEnter.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3DSUM(MOD(TIMEVALUE(RIGHT(A2%3AC2%2C5))-TIMEVALUE(LEFT(A2%3AC2%2C5))%2C1))%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EFormat%20D2%20with%20the%20custom%20number%20format%20%5Bh%5D%3Amm%3C%2FP%3E%0A%3CP%3EFill%20down%20if%20required.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22S0815.png%22%20style%3D%22width%3A%20729px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F316399i82109DDD1B87C571%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22S0815.png%22%20alt%3D%22S0815.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
New Contributor

I want to know if it´s possible to calculate (to subtract, in fact) two different hours (Arrival and departure) in the same cell, and then sum up this with others cells from other days. I don´t know if you guys understand what I mean.

This is the example:

 

Monday             Tuesday                 Wednesday          total hours

13:00 - 18:30       11:00 - 20:30         15:00 - 0:00             ???

 

Thanks in advance!!!!

 

 

2 Replies
best response confirmed by JuanAros (New Contributor)
Solution

@JuanAros 

Let's say the times are in A2:C2.

Enter the following formula in D2. If you are NOT using Excel in Microsoft 365 or Excel 2021, confirm the formula with Ctrl+Shift+Enter.

 

=SUM(MOD(TIMEVALUE(RIGHT(A2:C2,5))-TIMEVALUE(LEFT(A2:C2,5)),1))

 

Format D2 with the custom number format [h]:mm

Fill down if required.

S0815.png

It works perfectly, thanks a lot mate!