+ Reply to Thread
Results 1 to 8 of 8

Count how many times 3 or 4 is observed in a sequence: Tracking Bees

  1. #1
    Registered User
    Join Date
    07-25-2017
    Location
    Australia
    MS-Off Ver
    MS Office 2016
    Posts
    6

    Count how many times 3 or 4 is observed in a sequence: Tracking Bees

    Hi,

    I am new to the forum and was just hoping to get some help analysing my experimental results.

    I have attached an example spreadsheet of the data.

    Basically the data is generated by tracking bees using antennas. The antennas are numbered 1,2,3 or 4 (Column C).

    I need to count how many times 3 or 4 occur in a sequence. eg the count of (3,4,3,4,3) would equal 5.
    Antenna 1+2 can be ignored.

    Time Bee ID Antenna
    20170413T082042.394418+10 14 3 (eg.Either 3 or 4 occurred 5 times a row)
    20170413T082042.394418+10 14 4
    20170413T082042.660167+10 14 3
    20170413T082042.660167+10 14 4
    20170413T082042.919958+10 14 3

    Any help would be greatly appreciated.

    Cheers
    Attached Files Attached Files

  2. #2
    Forum Expert leelnich's Avatar
    Join Date
    03-20-2017
    Location
    Delaware, USA
    MS-Off Ver
    Office 2016
    Posts
    2,807

    Re: Count how many times 3 or 4 is observed in a sequence: Tracking Bees

    Try:
    =COUNTIF(C2:C54,">=3")

    If you want to guard against higher numbered antennae fouling the count, use this:
    =COUNTIFS(C2:C54,">=3",C2:C54,"<=4")

    Please click the Add Reputation star below any helpful posts, and if you have your answer, mark your thread as SOLVED (Thread Tools up top). Thanks!-Lee
    Last edited by leelnich; 07-25-2017 at 09:42 PM.

  3. #3
    Registered User
    Join Date
    07-25-2017
    Location
    Australia
    MS-Off Ver
    MS Office 2016
    Posts
    6

    Re: Count how many times 3 or 4 is observed in a sequence: Tracking Bees

    Thanks for your reply. This doesn't really work as it only provides a total count of 3 and 4s for the entire data set.

    Is there a way to say If Column C is >=3, it is a '1' ?

    Then in the next column I could just sum all of the 1's to give me my answer.

  4. #4
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Count how many times 3 or 4 is observed in a sequence: Tracking Bees

    Not sure I understand. Try array entering this formula and fill down until you get 0s. If you aren’t familiar with array-entered formulas array enter means the formula must be committed from edit mode by simultaneously pressing and holding down Ctrl and Shift while hitting Enter.
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    I get this with your data:
    17
    10
    9
    Dave

  5. #5
    Registered User
    Join Date
    07-25-2017
    Location
    Australia
    MS-Off Ver
    MS Office 2016
    Posts
    6

    Re: Count how many times 3 or 4 is observed in a sequence: Tracking Bees

    That works perfectly, thanks for your help!

  6. #6
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Count how many times 3 or 4 is observed in a sequence: Tracking Bees

    You're welcome. Thanks for the feedback.

  7. #7
    Registered User
    Join Date
    07-25-2017
    Location
    Australia
    MS-Off Ver
    MS Office 2016
    Posts
    6

    Re: Count how many times 3 or 4 is observed in a sequence: Tracking Bees

    I've just come back to using the formula provided by FlameRetired (above).
    However after a couple of months I can't get it to work properly (the only numbers it provides me with are 29 and 7).

    I was just wondering if someone could help me use the formula in the spreadsheet attached.

    Cheers
    Attached Files Attached Files

  8. #8
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Count how many times 3 or 4 is observed in a sequence: Tracking Bees

    Hi Rwtas.

    You'll need to change the range references to include the increased data. It is still array entered and returns counts down to about row 265 starting with

    1062
    466
    348
    197
    117

    =LARGE(FREQUENCY(IF(($C$2:$C$14596>=3)*($C$2:$C$14596<=4),ROW($A$2:$A$14596)),
    IF(NOT(($C$2:$C$14596>=3)*($C$2:$C$14596<=4)),ROW($A$2:$A$14596))),ROWS($2:2))

+ 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. Replies: 1
    Last Post: 01-06-2015, 04:16 AM
  2. How do i count the number of times a sequence appears in a row of data
    By dony85 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-02-2014, 01:57 PM
  3. Replies: 10
    Last Post: 07-18-2014, 06:11 AM
  4. Replies: 2
    Last Post: 10-11-2012, 02:54 PM
  5. Replies: 3
    Last Post: 03-07-2011, 06:34 PM
  6. Replies: 5
    Last Post: 11-22-2010, 06:31 PM
  7. Inserting and Tracking Missing Sequence
    By matt in forum Excel General
    Replies: 2
    Last Post: 09-12-2005, 12:05 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