+ Reply to Thread
Results 1 to 5 of 5

Count Most Recent Consecutive Non-Zero Values

  1. #1
    Registered User
    Join Date
    06-15-2019
    Location
    USA
    MS-Off Ver
    2016
    Posts
    3

    Count Most Recent Consecutive Non-Zero Values

    The basic idea is counting the number of days a value has been above zero and the results resetting if zero occurs, as seen below (results in bold):


    4 9 0 6 2 7 3
    1 0 0 4 0 7 1
    - - 1 4 9 0 0
    - 1 0 0 4 8 2

    There will be new additions on a rolling basis so some columns will be empty. I've tried various formulas with a mix of FREQUENCY, COUNTIF, and COLUMN-MATCH formulas with no success. Any help would be appreciated, a sample excel book is attached.
    Attached Files Attached Files
    Last edited by Aging; 06-15-2019 at 06:36 PM.

  2. #2
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Count Most Recent Consecutive Non-Zero Values

    Please try at T2
    =COLUMNS(A2:S2)-MATCH(1,INDEX(0/(A2:S2=0),))

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

    Re: Count Most Recent Consecutive Non-Zero Values

    Hi Aging and welcome to the forum,

    This takes an Array function where you need to do a Ctrl+Shift ENTER key combination to get the curly brackets around the formula. See the attached where I've done the correct formula in the Yellow fill cells.

    It looks like this:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Open the attached workbook below to see it work.
    CSE Numbers after last zero.xlsx
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  4. #4
    Registered User
    Join Date
    06-15-2019
    Location
    USA
    MS-Off Ver
    2016
    Posts
    3

    Re: Count Most Recent Consecutive Non-Zero Values

    This works! Thank you so much for your help!

  5. #5
    Registered User
    Join Date
    06-15-2019
    Location
    USA
    MS-Off Ver
    2016
    Posts
    3

    Re: Count Most Recent Consecutive Non-Zero Values

    Quote Originally Posted by MarvinP View Post
    Hi Aging and welcome to the forum,

    This takes an Array function where you need to do a Ctrl+Shift ENTER key combination to get the curly brackets around the formula. See the attached where I've done the correct formula in the Yellow fill cells.

    It looks like this:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Open the attached workbook below to see it work.
    Attachment 628455
    Appreciate the help!! Seems like I was trying to make it more complicated than it needed to be. Thank you!!!

+ 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: 2
    Last Post: 07-30-2018, 02:21 PM
  2. [SOLVED] Count consecutive most recent values.
    By VAMH2 in forum Excel General
    Replies: 24
    Last Post: 04-10-2018, 12:47 PM
  3. Count of Values (Rows) of Most Recent Consecutive Streak (2+ Distinct Values)
    By ExcelForum88 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-13-2016, 12:26 PM
  4. [SOLVED] Count most recent 12 values in a column that are >0 when values are added monthly
    By Phillycheese5 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 09-03-2014, 04:31 PM
  5. Count consecutive values
    By tbelanger007 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-14-2013, 03:39 PM
  6. Count Consecutive Values
    By roberto1111 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 02-05-2010, 05:33 AM
  7. [SOLVED] Count Intervals of 2 Consecutive Values in same Row and Return Count across Row
    By Sam via OfficeKB.com in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 11-29-2005, 11:30 AM

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