+ Reply to Thread
Results 1 to 4 of 4

counting consecutive cells

  1. #1
    Registered User
    Join Date
    05-03-2014
    Location
    United States
    MS-Off Ver
    Excel 2013
    Posts
    51

    counting consecutive cells

    im trying to find a formula that will count consecutive cells in a row as one to be used for attendance tracking. for instance if the data is a,a,0,0,a,0,0,0,a,a,a the count should come out 3 since it was 3 times a came up with consecutive days counting as one.

  2. #2
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,937

    Re: counting consecutive cells

    =SUM((FREQUENCY(IF(A1:K1="a",COLUMN(A1:K1)),IF(A1:K1<>"a",COLUMN(A1:K1)))>0)*1)
    Try this array formula
    Confirm with Shift+Ctrl+Enter
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

  3. #3
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: counting consecutive cells

    Hi.

    Based on data in A1:K1, array formula**:

    =SUM(IF(FREQUENCY(IF(A1:K1="a",COLUMN(A1:K1)),IF(A1:K1<>"a",COLUMN(A1:K1))),1))

    Regards


    **Array formulas are not entered in the same way as 'standard' formulas. Instead of pressing just ENTER, you first hold down CTRL and SHIFT, and only then press ENTER. If you've done it correctly, you'll notice Excel puts curly brackets {} around the formula (though do not attempt to manually insert these yourself).
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  4. #4
    Registered User
    Join Date
    05-03-2014
    Location
    United States
    MS-Off Ver
    Excel 2013
    Posts
    51

    Re: counting consecutive cells

    that works great thanks

+ 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: 6
    Last Post: 02-13-2015, 08:47 AM
  2. [SOLVED] Counting consecutive cells in a row
    By her.rockstar in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 04-04-2013, 12:44 PM
  3. Counting of consecutive cells
    By wolis in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-08-2012, 10:40 AM
  4. Counting consecutive cells
    By KMU in forum Excel General
    Replies: 3
    Last Post: 05-11-2010, 08:16 PM
  5. Counting Consecutive Cells
    By SteveC in forum Excel General
    Replies: 18
    Last Post: 06-21-2006, 01:46 PM

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