I have a spreadsheet that I'm trying to figure out a formula for, but I'm stuck. My data needs to be calculated across rows. I'm trying to calculate the last 12 (or more) months in consecutive order, when sales were bigger than 0 on each row. The catch is that I need to count those values from the end of the row before a 0 sales value occurs.
The columns all represent months of the year.
I have found a formula in the forums, which gives me the result of max consecutive values greater than 0 in a row, but it does not include the condition of LAST 12 or more months of non-zero sales, beginning to count from the right side of the row until the first month of 0 sales occur. The formula is the following:
=MAX(FREQUENCY(IF(D10:AP10>0;COLUMN(D10:AP10));IF(D10:AP10<=0;COLUMN(D10:AP10))))
For example > the formula applied for the marked row returns a count of 24 (counting the values where sales were bigger than 0), though the needed result should be 0, because counting from the last month of sales (from the right side) - there were no sales.
Thank You!
The columns all represent months of the year.
I have found a formula in the forums, which gives me the result of max consecutive values greater than 0 in a row, but it does not include the condition of LAST 12 or more months of non-zero sales, beginning to count from the right side of the row until the first month of 0 sales occur. The formula is the following:
=MAX(FREQUENCY(IF(D10:AP10>0;COLUMN(D10:AP10));IF(D10:AP10<=0;COLUMN(D10:AP10))))
For example > the formula applied for the marked row returns a count of 24 (counting the values where sales were bigger than 0), though the needed result should be 0, because counting from the last month of sales (from the right side) - there were no sales.
Thank You!