+ Reply to Thread
Results 1 to 4 of 4

Counting the number of occurances with consecutive values above zero

  1. #1
    Registered User
    Join Date
    03-06-2015
    Location
    Atlanta, GA
    MS-Off Ver
    Office 365 ProPlus
    Posts
    6

    Counting the number of occurances with consecutive values above zero

    I am trying to count the number of instances where an item has received orders in consecutive months.

    In column P I have hardcoded the answers but I want to find a formula that will do this for me

    Book3.xlsx

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

    Re: Counting the number of occurances with consecutive values above zero

    =SUM((FREQUENCY(IF(B2:M2>0,COLUMN(B2:M2)),IF(B2:M2<=0,COLUMN(B2:M2)))>0)*1)
    try this array formula(Shift+Ctrl+Enter) and copy towards down
    Samba

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

  3. #3
    Forum Expert
    Join Date
    12-15-2009
    Location
    Chicago, IL
    MS-Off Ver
    Microsoft Office 365
    Posts
    3,177

    Re: Counting the number of occurances with consecutive values above zero

    If your report gets too big, UDF might be a better option since it doesn't require as much memory as array formula.

    Please Login or Register  to view this content.
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    03-06-2015
    Location
    Atlanta, GA
    MS-Off Ver
    Office 365 ProPlus
    Posts
    6

    Re: Counting the number of occurances with consecutive values above zero

    Unfortunately that didn't quite work. If an item was ordered for one month, it is counting that in the total. One month shouldn't be calculated. An item would need to be ordered for two months or more

+ 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] How to count consecutive occurances of values greater than 0?
    By lhorner in forum Excel General
    Replies: 7
    Last Post: 05-01-2021, 11:03 AM
  2. [SOLVED] Counting maximum number of consecutive missing values
    By Moriexcel in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-18-2014, 04:45 AM
  3. [SOLVED] Counting the number of occurances
    By Losguapos1 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-05-2014, 09:41 AM
  4. Counting number of occurances matched with certain value
    By lucyscholz in forum Excel General
    Replies: 1
    Last Post: 08-31-2014, 06:07 PM
  5. Counting number of occurances in a range using VBA
    By welchs101 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-16-2010, 12:43 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