I'm sure there are LOTS of approaches to this, but using simple Excel functions, I went with this approach: Assuming: From: time is in row 1 To: time is in row 2 Data begins in row 3 I added a blank column at column B to show that that at the start of the day, no task is being worked on. I added in cell K3, the formula: =IF(C3<>B3,IF(C3="X","Start","Stop"),"") The logic is: If the previous cell is not the same as the current cell, then a task was started or stopped. If the current cell has an "X", then the task was started, if it is blank, then it was stopped. copying this formula across and down, you get: Start Stop Start Stop Start blank blank blank Start Stop blank blank Start Stop Start blank blank blank Stop blank blank ( inserted the word "blank" to show where empty cells would show) Next, in Cell J3 I inserted: =COUNTIF(K3:Q3,"start")-1 and copied it down. This counts the number of tims a task was STARTED, then subtracts 1 to count the number of starts except for the first.
Paul ----------------------------------------- “Do all the good you can, By all the means you can, In all the ways you can, In all the places you can, At all the times you can, To all the people you can, As long as ever you can.” - John Wesley ----------------------------------------- From: "jlobrien...@gmail.com" <jlobrien...@gmail.com> >To: excel-macros@googlegroups.com >Sent: Thursday, October 9, 2014 1:44 PM >Subject: $$Excel-Macros$$ Calculating Number of Context Changes in a Series > > > >Hello! > > >I have a spreadsheet of time tracking data. Each row is a different activity >and members are tracking time to that activity by entering an "x" for each 15 >minute interval that they completed that activity. I would like to calculate >per task, how many times they started and stopped that activity. > > >For example, Task A had 2 switches because they started the task, switched to >another, came back again, switched to another task and came back a third time. > >Task B had one 1 switch >Task C had 0 switches, because once they started, they completed and then >didn't come back to it again. > > >Is there a calculation that could automatically count the number of gaps once >a series has started? > > > >From 7:00 7:15 7:30 7:45 8:00 8:15 8:30 >To 7:15 7:30 7:45 8:00 8:15 8:30 8:45 >Task A x x x x x >Task B x x >Task C x x x x > >Thank you in advance for any help you can provide! >Jaime -- >Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s >=TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @ >https://www.facebook.com/discussexcel > >FORUM RULES > >1) Use concise, accurate thread titles. Poor thread titles, like Please Help, >Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get >quick attention or may not be answered. >2) Don't post a question in the thread of another member. >3) Don't post questions regarding breaking or bypassing any security measure. >4) Acknowledge the responses you receive, good or bad. >5) Jobs posting is not allowed. >6) Sharing copyrighted material and their links is not allowed. > >NOTE : Don't ever post confidential data in a workbook. Forum owners and >members are not responsible for any loss. >--- >You received this message because you are subscribed to the Google Groups "MS >EXCEL AND VBA MACROS" group. >To unsubscribe from this group and stop receiving emails from it, send an >email to excel-macros+unsubscr...@googlegroups.com. >To post to this group, send email to excel-macros@googlegroups.com. >Visit this group at http://groups.google.com/group/excel-macros. >For more options, visit https://groups.google.com/d/optout. > > > -- Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s =TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @ https://www.facebook.com/discussexcel FORUM RULES 1) Use concise, accurate thread titles. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get quick attention or may not be answered. 2) Don't post a question in the thread of another member. 3) Don't post questions regarding breaking or bypassing any security measure. 4) Acknowledge the responses you receive, good or bad. 5) Jobs posting is not allowed. 6) Sharing copyrighted material and their links is not allowed. NOTE : Don't ever post confidential data in a workbook. Forum owners and members are not responsible for any loss. --- You received this message because you are subscribed to the Google Groups "MS EXCEL AND VBA MACROS" group. To unsubscribe from this group and stop receiving emails from it, send an email to excel-macros+unsubscr...@googlegroups.com. To post to this group, send email to excel-macros@googlegroups.com. Visit this group at http://groups.google.com/group/excel-macros. For more options, visit https://groups.google.com/d/optout.