+ Reply to Thread
Results 1 to 7 of 7

Counting consecutive cells that have value, IF there are 3 consecutive cells, just once

  1. #1
    Registered User
    Join Date
    02-13-2015
    Location
    CROATIA
    MS-Off Ver
    2013
    Posts
    4

    Counting consecutive cells that have value, IF there are 3 consecutive cells, just once

    Hello,

    my first post here, sofar i have always been able to find a solution reading someone elses problems. here is mine:

    I have rows with client numbers and columns with months in 1 year. Some clients have payments in some months. I need to:

    - find in which month starts the occurence of 3 consecutive cells with payments (so > 0)
    - sum them up (only those 3)
    - ignore any other occurence of 3 consecutive cells that fulfill the mentioned conditions
    - if there are no occurences, mark, put a string or number into the resulting cell (like "no data")
    - if the 1st payment occurs in november or december (so there is not enough months to meet the 3-cell condition), put a string "forecast", or something numerical


    Let me attach an example table with dummy data and what should resulting cells contain.

    Book1.xlsx


    Thanks a lot for your help
    Last edited by peraklo; 02-13-2015 at 07:45 AM.

  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 consecutive cells that have value, IF there are 3 consecutive cells, just onc

    For Client no.1 Mar is 0 and april is 5463 then what is your result for jan
    Samba

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

  3. #3
    Registered User
    Join Date
    02-13-2015
    Location
    CROATIA
    MS-Off Ver
    2013
    Posts
    4

    Re: Counting consecutive cells that have value, IF there are 3 consecutive cells, just onc

    i just double checked the table, as i can see, for client 1, Mar is 5463 and Apr is 0. so His 1st (and only relevant) 3-cell occurence starts in Jan and sums up to 10270.

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

    Re: Counting consecutive cells that have value, IF there are 3 consecutive cells, just onc

    i am not asking about original data
    for suppose if For Client no.1 Mar is 0 and april is 5463 then what is your result for jan

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

    Re: Counting consecutive cells that have value, IF there are 3 consecutive cells, just onc

    Then
    =IFERROR(IF(SUM(INDEX(B2:M2,MATCH(N2,B$1:M$1,0)):INDEX(B2:M2,MATCH(N2,B$1:M$1,0)+2))=0,"No Data",SUM(INDEX(B2:M2,MATCH(N2,B$1:M$1,0)):INDEX(B2:M2,MATCH(N2,B$1:M$1,0)+2))),"Forecast")
    Try this

  6. #6
    Registered User
    Join Date
    02-13-2015
    Location
    CROATIA
    MS-Off Ver
    2013
    Posts
    4

    Re: Counting consecutive cells that have value, IF there are 3 consecutive cells, just onc

    There is no result needed for Jan, only for Client no 1. In the case of Mar=0 and Apr>0, result for that client would be July with sum of 10270.

  7. #7
    Registered User
    Join Date
    02-13-2015
    Location
    CROATIA
    MS-Off Ver
    2013
    Posts
    4

    Re: Counting consecutive cells that have value, IF there are 3 consecutive cells, just onc

    Quote Originally Posted by nflsales View Post
    Then
    =IFERROR(IF(SUM(INDEX(B2:M2,MATCH(N2,B$1:M$1,0)):INDEX(B2:M2,MATCH(N2,B$1:M$1,0)+2))=0,"No Data",SUM(INDEX(B2:M2,MATCH(N2,B$1:M$1,0)):INDEX(B2:M2,MATCH(N2,B$1:M$1,0)+2))),"Forecast")
    Try this
    This formula works, for summing up, thanks. Can you come up with a formula for month column, that would find that month of 1st occurence and fill it with A2:M2 data (month names)?

+ 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: 1
    Last Post: 05-29-2013, 10:35 AM
  2. [SOLVED] Counting consecutive cells in a row
    By her.rockstar in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 04-04-2013, 12:44 PM
  3. Counting of consecutive cells
    By wolis in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-08-2012, 10:40 AM
  4. Counting consecutive cells
    By KMU in forum Excel General
    Replies: 3
    Last Post: 05-11-2010, 08:16 PM
  5. Counting Consecutive Cells
    By SteveC in forum Excel General
    Replies: 18
    Last Post: 06-21-2006, 01:46 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