Home

total and subtotal time

%3CLINGO-SUB%20id%3D%22lingo-sub-633739%22%20slang%3D%22en-US%22%3Etotal%20and%20subtotal%20time%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-633739%22%20slang%3D%22en-US%22%3E%3CP%3EI%20have%20the%20need%20to%20calculate%20the%20accumulating%20time%20and%20then%20the%20subtotal%20when%20a%20value%20in%20another%20column%20changes.%20My%20example%20would%20be%20Column%20A%20is%20date%2Ftime%3B%20Column%20B%20contains%20one%20of%20the%20following%20%22Start%22%2C%20%22Update%22%20and%20%22Stop%22.%26nbsp%3B%20I%20need%20to%20sum%20the%20time%20if%20Column%20B%20is%20%22Start%22%20and%20%22Update%22%20and%20subtotal%20when%20it%20is%20%22Stop%22%20and%20then%20start%20the%20sum%20again%20on%20the%20next%20%22Start%22.%26nbsp%3B%20Also%20if%20I%20get%20two%20%22Start%22s%20in%20a%20row%20flag%20the%20row%20of%20data%20and%20either%20continue%20the%20suming%20or%20give%20the%20user%20the%20choice%20to%20continue%20suming%20or%20force%20a%20subtotal%20or%20at%20least%20check%20to%20see%20if%20there%20was%20a%20missing%20%22Stop%22.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-633739%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-633835%22%20slang%3D%22en-US%22%3ERe%3A%20total%20and%20subtotal%20time%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-633835%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F346605%22%20target%3D%22_blank%22%3E%40jspry%3C%2FA%3E%26nbsp%3B%2C%20for%20the%20model%20like%20this%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20341px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F115676i953BDF7D6ABA0C91%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22image.png%22%20title%3D%22image.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3Ecumulative%20time%20could%20be%20calculated%20as%3C%2FP%3E%0A%3CPRE%3E%3DIF((%24B2%3D%22Start%22)*NOT(%20%20%20(COUNTIF(%24B1%3AB%242%2C%22Stop%22)%26lt%3B%26gt%3BCOUNTIF(%24B1%3AB%242%2C%22Start%22))*(COUNTIF(%24B1%3AB%242%2C%22Start%22)%26gt%3B1)*(%24B2%3D%22Start%22)%20%20)%2C0%2C%24A2-N(%24A1)%2BN(%24C1))%3C%2FPRE%3E%0A%3CP%3Eand%20Start%20without%20previous%20Stop%20highlighted%20with%20conditional%20formatting%20rule%20with%20formula%3C%2FP%3E%0A%3CPRE%3E%3D(COUNTIF(%24B1%3AB%242%2C%22Stop%22)%26lt%3B%26gt%3BCOUNTIF(%24B1%3AB%242%2C%22Start%22))*(COUNTIF(%24B1%3AB%242%2C%22Start%22)%26gt%3B1)*(%24B2%3D%22Start%22)%3C%2FPRE%3E%0A%3CP%3Eapplied%20to%20the%20column%20B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-633839%22%20slang%3D%22en-US%22%3ERe%3A%20total%20and%20subtotal%20time%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-633839%22%20slang%3D%22en-US%22%3EGiven%20that%20you%20used%20many%20or%E2%80%99s%20in%20your%20explanation%2C%20please%20attach%20your%20sample%20file%20with%20desired%20results%20so%20that%20the%20logic%20thereof%20could%20be%20deciphered.%3C%2FLINGO-BODY%3E
jspry
Occasional Visitor

I have the need to calculate the accumulating time and then the subtotal when a value in another column changes. My example would be Column A is date/time; Column B contains one of the following "Start", "Update" and "Stop".  I need to sum the time if Column B is "Start" and "Update" and subtotal when it is "Stop" and then start the sum again on the next "Start".  Also if I get two "Start"s in a row flag the row of data and either continue the suming or give the user the choice to continue suming or force a subtotal or at least check to see if there was a missing "Stop".

2 Replies
Highlighted

@jspry , for the model like this

image.png

cumulative time could be calculated as

=IF(($B2="Start")*NOT(   (COUNTIF($B1:B$2,"Stop")<>COUNTIF($B1:B$2,"Start"))*(COUNTIF($B1:B$2,"Start")>1)*($B2="Start")  ),0,$A2-N($A1)+N($C1))

and Start without previous Stop highlighted with conditional formatting rule with formula

=(COUNTIF($B1:B$2,"Stop")<>COUNTIF($B1:B$2,"Start"))*(COUNTIF($B1:B$2,"Start")>1)*($B2="Start")

applied to the column B

Given that you used many or’s in your explanation, please attach your sample file with desired results so that the logic thereof could be deciphered.
Related Conversations
flashing a white screen while open new tab
cntvertex in Discussions on
13 Replies
Tabs and Dark Mode
cjc2112 in Discussions on
22 Replies
Stable version of Edge insider browser
HotCakeX in Discussions on
35 Replies
How to Prevent Teams from Auto-Launch
chenrylee in Microsoft Teams on
28 Replies
PacketMon Components are not loading in WAC 1909
HotCakeX in Windows Admin Center on
2 Replies