+ Reply to Thread
Results 1 to 5 of 5

How do you count consecutive values backward from the last cell?- Please help!

  1. #1
    Registered User
    Join Date
    05-26-2015
    Location
    Rogers, Arkansas
    MS-Off Ver
    2010
    Posts
    1

    How do you count consecutive values backward from the last cell?- Please help!

    I need a formula for the below!!! Help!

    Basically, I want excel to look at the last week of data, and if the cell is 0, count back how many times it was consecutively 0.
    Ex.
    Row 1: 0 3 3 0 answer: 1
    Row 2: 0 0 0 0 answer: 4
    Row 3: 0 1 0 4 answer: 0
    Row 4: 5 -1 0 0 answer: 2

    The simplier the formula the better. I want to be able to use this formula for any timeframe I pull.
    Thank you!

    ex.JPG

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

    Re: How do you count consecutive values backward from the last cell?- Please help!

    pls attach sample excel file
    Samba

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

  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: How do you count consecutive values backward from the last cell?- Please help!

    Assuming no empty cells...

    Data Range
    A
    B
    C
    D
    E
    F
    1
    ------
    ------
    ------
    ------
    ------
    Count
    2
    0
    0
    0
    0
    0
    5
    3
    1
    0
    0
    0
    0
    4
    4
    1
    1
    0
    0
    0
    3
    5
    1
    1
    1
    0
    0
    2
    6
    1
    1
    1
    1
    0
    1
    7
    1
    1
    1
    1
    1
    0


    This array formula** entered in F2 and copied down:

    =IFERROR(COLUMNS(A2:E2)-MATCH(2,1/(A2:E2<>0)),COLUMNS(A2:E2))

    ** 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 Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: How do you count consecutive values backward from the last cell?- Please help!

    =column()-1-sumproduct(max((a1:e1<>0)*column(a1:e1)))

  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: How do you count consecutive values backward from the last cell?- Please help!

    Quote Originally Posted by nflsales View Post
    =column()-1-sumproduct(max((a1:e1<>0)*column(a1:e1)))
    That formula is dependent upon what cell it's entered in.

+ 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. Count of consecutive values in a row
    By Bruno Silva in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 04-12-2013, 09:19 AM
  2. [SOLVED] Make a backward message by reversing the entire order of values in cell?
    By mc84excel in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 01-16-2013, 11:11 PM
  3. Count non-consecutive values
    By Kerrigan7 in forum Excel General
    Replies: 2
    Last Post: 11-10-2011, 09:34 AM
  4. Count Consecutive Values
    By roberto1111 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 02-05-2010, 05:33 AM
  5. [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