+ Reply to Thread
Results 1 to 2 of 2

Count starts and stops of a motor with a single column of 1s and 0s

  1. #1
    Registered User
    Join Date
    03-10-2021
    Location
    Texas
    MS-Off Ver
    2019
    Posts
    1

    Count starts and stops of a motor with a single column of 1s and 0s

    I am trying to find the amount of state changes in a row of 1s and 0s. So its a motor on and off and I am trying to figure out how many time the motor has started and stopped.
    Every time the column changes from a 1 to a 0 or a 0 to a 1 I need a separate count for each.

    The direction I have been trying to go with the formula is...

    =COUNTIF(B2:B20,(=INDIRECT(ADDRESS,(ROW(B:B)-1,COLUMN(2:2)))))

    what I want is something that is similar to this...

    =COUNTIF(B2:B20, current cell is equal to 1 and above cell is equal to 0)
    &
    =COUNTIF(B2:B20, current cell is equal to 0 and above cell is equal to 1)

    I just do not know how to write this but I will also take a better code (hopefully with an explanation of how it works).
    I realize if I go with this I would probably need to add a new second row with a base value of 0 to count the first motor start.

    If this has already been answered somewhere else I will gladly delete this post if I'm pointed in the right direction.
    Attached Files Attached Files
    Last edited by edak222; 03-19-2021 at 06:51 PM.

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,602

    Re: Count starts and stops of a motor with a single column of 1s and 0s

    B2:
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Ben Van Johnson

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Calculate elapsed seconds betwn 2 datetime, starts and stops on different days
    By bteague in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 08-03-2020, 11:07 AM
  2. find count if column has values that starts with certain texts
    By linok in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-17-2015, 11:58 PM
  3. [SOLVED] Single Column, Count all of the various Entries
    By paulymaggs in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-27-2013, 07:04 AM
  4. [SOLVED] Count text in one column Matching single or multiple Criteria from Other Column Excel 2003
    By Jose Macieira in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 07-17-2013, 06:55 AM
  5. Replies: 0
    Last Post: 01-09-2013, 10:15 AM
  6. Count down time and count up timer does not starts in another sheet(s)
    By marc5354 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-03-2010, 06:08 PM
  7. Count down time and count up timer does not starts in another sheet(s)
    By marc5354 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-01-2010, 07:52 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1