+ Reply to Thread
Results 1 to 4 of 4

Counting Consecutive values and saving them

  1. #1
    Registered User
    Join Date
    06-11-2013
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    1

    Counting Consecutive values and saving them

    I want to count consecutive values and save each value to a report. So I have hundreds of these, 1 col wide, 48 rows. These contain the word blank and this is what I want to count. I want to count consecutive blanks. So the example below I would have a report that shows me....

    Consecutive Blanks with corresponding count value
    1 consecutive blanks = 2
    2 consecutive blanks = 2
    3 consecutive blanks = 2
    4 consecutive blanks = 2
    5 consecutive blanks = 0
    6 consecutive blanks = 0
    7 consecutive blanks = 0
    8 consecutive blanks = 0


    You get the idea....don't have to show 0's. I would want to be able to select multiple sheets within 1 book.


    Blank
    Blank
    Server
    Server
    Server
    Server
    Server
    Server
    Blank
    Server
    Server
    Server
    Server
    Server
    Server
    Server
    Server
    Server
    Blank
    Server
    Server
    Server
    Blank
    Blank
    Blank
    Blank
    Server
    Server
    Blank
    Blank
    Blank
    Server
    Server
    Server
    Blank
    Blank
    Blank
    Server
    Server
    Server
    Blank
    Blank
    Server
    Server
    Blank
    Blank
    Blank
    Blank

  2. #2
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: Counting Consecutive values and saving them

    Try this:-
    Data column "A" Results column "C".
    Please Login or Register  to view this content.
    Regards Mick

  3. #3
    Valued Forum Contributor
    Join Date
    03-21-2013
    Location
    cyberia
    MS-Off Ver
    Excel 2007
    Posts
    457

    Re: Counting Consecutive values and saving them

    just for variety
    Please Login or Register  to view this content.

  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: Counting Consecutive values and saving them

    Here's a formula method...

    Data in the range A2:A49.

    C2:C9 = 1,2,3,4,5,6,7,8

    Enter this array formula** in D2:

    =SUM(IF(FREQUENCY(IF(A$2:A$49="blank",ROW(A$2:A$49)),IF(A$2:A$49<>"blank",ROW(A$2:A$49)))=C2,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.

    Copy down to D9.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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