+ Reply to Thread
Results 1 to 3 of 3

I want to count the number of columns since last non zero value.

  1. #1
    Registered User
    Join Date
    01-27-2017
    Location
    Atlanta, Georgia
    MS-Off Ver
    Office 365
    Posts
    2

    I want to count the number of columns since last non zero value.

    M J16 F M A M J J A S O N D J17
    7 0 0 0 0 0 28 0 0 0 0 0 0 0
    3 0 0 0 0 32 24 0 0 0 24 0 0 0
    0 0 0 0 0 40 0 0 56 0 24 0 32 24
    7 0 0 0 0 0 48 0 0 0 0 0 0 0

    M = Months Since Last Referral, 0 = no referral that month

    the first column is my manual math, for instance it has 7 in Row 2 because there is no number greater than 0 since June, July-Jan(17) = 7 months
    the first column is my manual math, for instance it has 3 in Row 3 because there is no number greater than 0 since October, Nov-Jan(17) = 3 months

    What kind of formula can I use to determine this automatically?

    Also, I will add new columns for every month, so how can I make this work going forward.

  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: I want to count the number of columns since last non zero value.

    Hi and welcome to the forum.

    Please upload a workbook or a representative cut down copy, anonymised if necessary. It is always easier to advise if we can see your request in its context.

    Show a before and after situation with manually calculated results, explaining which information is data and which is results, and if it's not blindingly obvious how you have arrived at your results some explanatory notes as well.
    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
    01-27-2017
    Location
    Atlanta, Georgia
    MS-Off Ver
    Office 365
    Posts
    2

    Re: I want to count the number of columns since last non zero value.

    Here you go.
    Attached Files Attached Files

+ 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 blanks across several columns
    By shepherdc2814 in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 11-19-2013, 05:26 PM
  2. [SOLVED] count number of pivot columns
    By MarMo in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 02-01-2013, 08:52 AM
  3. Number of Rows or Columns count
    By zulkfal in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-19-2012, 11:40 PM
  4. [SOLVED] Count unique value for each row in a number of Columns
    By rickyilas in forum Excel General
    Replies: 6
    Last Post: 05-23-2012, 09:14 PM
  5. compare columns and count number of matching columns
    By san000 in forum Excel General
    Replies: 1
    Last Post: 07-15-2009, 10:31 PM
  6. VBA to count number of columns
    By blucky in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-13-2008, 09:20 AM
  7. Count Number of Columns
    By mrdata in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 11-03-2007, 04:44 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