Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
Solved

# Sequential occurances of less than value in excel

Posted on 2014-04-22
Medium Priority
174 Views
I'm looking for a formula that will return the value of 4 in cell A2.  It answers the question:  What is the maximum number of times in sequence was the value of -10 exceeded in A4:A16?

ThanksExample.xlsx
0
[X]
###### Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

• Help others & share knowledge
• Earn cash & points

LVL 5

Expert Comment

ID: 40015832
Hi there,

My first response would be to create a countif formula such as: =COUNTIF(A4:A16,">-10")

However, where is your sequence within a4:a16 ? because that would add to the formula to get an answer of 4.
0

LVL 43

Expert Comment

ID: 40015871
=COUNTIF(A4:A16,">"&A1)

but for the given data the answer is 7
0

LVL 8

Expert Comment

ID: 40015880
Try this but i don't know why your answer is 4 mine is 6
=FREQUENCY(A4:A16,A1)

Thanks
0

LVL 27

Accepted Solution

ID: 40015900
Put this array formula (Press CTRL+SHIFT+ENTER) in A2:
``````=MAX(FREQUENCY(IF(A4:A16<=-10,ROW(A4:A16)),IF(A4:A16>-10,ROW(A4:A16))))
``````
0

Author Closing Comment

ID: 40016069
Worked like a charm!
0

LVL 8

Expert Comment

ID: 40016786

will you pls explain the logic behind the  formula & why answer is 4?

Thanks You
0

## Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
After seeing numerous questions for Dynamic Data Validation I notice that most have used Visual Basic to solve the problem. This suggestion is purely formula based and can be used in multiple rows.
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …