+ Reply to Thread
Results 1 to 5 of 5

Count cells in a range, starting from first cell with number that does not equal zero

  1. #1
    Registered User
    Join Date
    02-26-2014
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2010
    Posts
    6

    Count cells in a range, starting from first cell with number that does not equal zero

    Hi,

    I'm trying to count the number of cells in a row, however starting from the first non-zero number.
    I also want to include any subsequent cells that contain zeros, as on the attachment (eg I want cell K4 to be counted).
    Row N is where I want the number of cells to be entered.

    Hoping someone can help!

    Thanks,
    Attached Files Attached Files

  2. #2
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Count cells in a range, starting from first cell with number that does not equal zero

    Enter the following as an ARRAY FORMULA (Press Ctrl-Shift-Enter) in N4:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Then copy down.
    let Source = #table({"Question","Thread", "User"},{{"Answered","Mark Solved", "Add Reputation"}}) in Source

    If I give you Power Query (Get & Transform Data) code, and you don't know what to do with it, then CLICK HERE

    Walking the tightrope between genius and eejit...

  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: Count cells in a range, starting from first cell with number that does not equal zero

    Try this array formula** entered in N4 and copied down:

    =COUNT(M4:INDEX(A4:M4,MATCH(TRUE,A4:M4<>0,0)))

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

    Note that your sample file is set to manual calculation.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  4. #4
    Registered User
    Join Date
    02-26-2014
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Count cells in a range, starting from first cell with number that does not equal zero

    Thanks guys

  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: Count cells in a range, starting from first cell with number that does not equal zero

    You're welcome!

+ 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 number of cells in Column C that have a lesser or equal value to the adjacent cell
    By Geoff Jones in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 12-18-2013, 11:01 AM
  2. Count 52 Cells Starting From First Non Blank Cell In Range
    By Caedmonball19 in forum Excel Formulas & Functions
    Replies: 21
    Last Post: 08-20-2013, 12:23 PM
  3. Sum cells in a range based between two equal cell values in another range
    By sshone1 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-09-2013, 08:12 AM
  4. Excel 2007 : Count number of cells less than or equal to today's date
    By marthadanielle in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 01-10-2013, 08:13 PM
  5. [SOLVED] Formulas count cells that do NOT equal a cell
    By boll55 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 10-01-2012, 08:53 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