One way:
=MATCH(2,(1/(A1:A6=D1)))-MATCH(2,(1/(A1:INDEX(A:A,MATCH(2,(1/(A1:A6=D1)))-1)=D1)))
where A1:A6 is the whole range of numbers and D1 contains the number to evaluate (e.g. 15)
Note: The formula must be confirmed with CTRL+SHIFT+ENTER not just ENTER. You will see { } brackets appear around the formula.
Bookmarks