+ Reply to Thread
Results 1 to 5 of 5

Consecutive cells count

  1. #1
    Forum Contributor
    Join Date
    02-23-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    133

    Consecutive cells count

    Hello,

    I thought this should be simple and googled a lot.

    1.A
    2.B
    3.A
    4.A
    5.B
    6.A
    7.A
    8.B
    9.A
    10.A


    I need consecutive count for A which is 3 in this case.. rows 3,4 and 6,7..9,10
    I tried something like =IF(L2=L1,M1+1,1) but it gives me 1,2,3,4.. But i need total count as in above eg, i need 3 in some cell.

    Thank you.

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,482

    Re: Consecutive cells count

    Not sure what you mean by 3, where does 3 come from?

  3. #3
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Consecutive cells count

    If you mean the result should be 4 then try this array formula**:

    =SUM(IF(FREQUENCY(IF(A1:A10="A",ROW(A1:A10)),IF(A1:A10<>"A",ROW(A1:A10))),1))

    ** array formulas need to be entered using the key
    combination of CTRL,SHIFT,ENTER (not just ENTER).
    Hold down both the CTRL key and the SHIFT key
    then hit ENTER.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  4. #4
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Consecutive cells count

    After reading your post again I now think I understand.

    You want to count how many times "A" appears in consecutive cells.

    Try this array formula**:

    =SUM(IF(FREQUENCY(IF(A1:A10="A",ROW(A1:A10)),IF(A1:A10<>"A",ROW(A1:A10)))>1,1))

    ** array formulas need to be entered using the key
    combination of CTRL,SHIFT,ENTER (not just ENTER).
    Hold down both the CTRL key and the SHIFT key
    then hit ENTER.

  5. #5
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,168

    Re: Consecutive cells count

    Hi moonbreakker,

    I think you want something different than the answers above. I think you want to know how many times the column cells are the same. You are correct it is hard to explain. I've created a Helper column and a formula that I think you want in the attached.
    Attached Files Attached Files
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say 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. [SOLVED] Count Consecutive Cells with Same Value
    By phelbin in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 05-13-2020, 11:29 PM
  2. Replies: 2
    Last Post: 07-25-2013, 01:01 PM
  3. Count number of consecutive cells
    By skullte in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 05-07-2013, 03:20 AM
  4. [SOLVED] Count consecutive cells with certain text
    By moppyau in forum Excel Formulas & Functions
    Replies: 19
    Last Post: 04-30-2013, 09:35 AM
  5. need help to count with condition on two consecutive cells
    By beyma in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-29-2012, 08:15 PM
  6. Count Consecutive Cells
    By Trapper via OfficeKB.com in forum Excel General
    Replies: 10
    Last Post: 05-24-2005, 06:32 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