+ Reply to Thread
Results 1 to 8 of 8

Consecutive numbers ignoring blanks

  1. #1
    Registered User
    Join Date
    09-07-2009
    Location
    Lytham, England
    MS-Off Ver
    Excel 2003+07
    Posts
    75

    Consecutive numbers ignoring blanks

    I am trying to return the consecutive times a certain number or letter appears excluding any blanks. i.e. "1,1, blank,1,blank,blank,1,2,1,blank" the formula (if trying to see the number of consecutive 1s would return 4 as 1 appears consecutively 4 times.

    I have attached an example.

    Kind Regards
    Paul
    Attached Files Attached Files
    Last edited by pdauction; 08-30-2016 at 07:49 AM.

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Consecutive numbers ignoring blanks

    Good morning,

    Try

    A2:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    B2 copied across
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    09-07-2009
    Location
    Lytham, England
    MS-Off Ver
    Excel 2003+07
    Posts
    75

    Re: Consecutive numbers ignoring blanks

    Thanks Richard - this doesn't seem to work unless I have misread.

    I am trying to find a formula that advises the maximum times a number is displayed consecutively in a row when blank cells are discounted. This should also work if the characters are letters.

  4. #4
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,513

    Re: Consecutive numbers ignoring blanks

    This needs UDF. Is it Ok.

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

    Re: Consecutive numbers ignoring blanks

    I didn't download your file.

    Maybe this...

    Data Range
    A
    B
    C
    D
    E
    F
    G
    H
    I
    J
    1
    1
    1
    1
    1
    2
    1
    2
    -----
    -----
    -----
    -----
    -----
    -----
    -----
    -----
    -----
    -----
    3
    4
    5
    4


    This array formula** entered in A5:

    =MAX(FREQUENCY(IF(A1:J1=1,COLUMN(A1:J1)),IF(A1:J1<>1,IF(A1:J1<>"",COLUMN(A1:J1)))))

    ** 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.

  6. #6
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Consecutive numbers ignoring blanks

    Quote Originally Posted by pdauction View Post
    Thanks Richard - this doesn't seem to work unless I have misread.

    I am trying to find a formula that advises the maximum times a number is displayed consecutively in a row when blank cells are discounted. This should also work if the characters are letters.
    Hi,

    This is the example workbook I used. Formulae now on row 10
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    09-07-2009
    Location
    Lytham, England
    MS-Off Ver
    Excel 2003+07
    Posts
    75

    Re: Consecutive numbers ignoring blanks

    That's really excellent and works perfectly, thanks.

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

    Re: Consecutive numbers ignoring blanks

    You're welcome. Thanks for the feedback!

+ 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] Data Cleanup - ignoring blanks, ignoring rows with string values etc.
    By Huyaku in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-21-2015, 08:17 AM
  2. Replies: 6
    Last Post: 12-04-2014, 10:39 AM
  3. Replies: 2
    Last Post: 12-04-2014, 06:25 AM
  4. Replies: 2
    Last Post: 12-04-2014, 06:23 AM
  5. Replies: 2
    Last Post: 12-04-2014, 06:22 AM
  6. [SOLVED] Average last n numbers ignoring blanks
    By Cryptic in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 06-06-2013, 07:05 AM
  7. Replies: 3
    Last Post: 06-17-2010, 03:04 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