I have a column with running hours of a machine I have (these are filled in by hand).
After the machine breaks down the machine will be repaired and the hour counter will be reset to 0 hours.
The first cell (in the screenshot) with the number 2538 in it is calculated by using:
=IF(COUNTIF(K2:K31,"0"),INDEX(K2:K31,MATCH(0,K2:K31,0)-1,1),"false")
K2:K31 is the hours column.
This code now only check if there is a 0, then find a match in the column, selects the first 0 it finds, then selects the cell above and show the value of this cell.
The problem is that I can't find a way to skip the first 0 and show the value above the second zero, is this case the result should be 476. After i know how do this it would probably be easy to change the code and also check for the value above the third zero, which in this case should be 105.
I can't use VBA so it has to be a formula and I'm using Excel 2016 Pro and no MS365.
| Running Hours |
|---|
| 2122 |
| 2230 |
| 2345 |
| 2447 |
| 2538 |
| 0 |
| 100 |
| 233 |
| 421 |
| 444 |
| 448 |
| 460 |
| 475 |
| 476 |
| 0 |
| 10 |
| 13 |
| 18 |
| 25 |
| 54 |
| 70 |
| 100 |
| 101 |
| 105 |
| 0 |
| 4 |
| 8 |
| 156 |
| 250 |
| 300 |
| Header | Value Above 0 |
|---|---|
| Number Above First Zero | 2538 |
| Number Above Second Zero | 476 |
| Number Above Third Zero | 105 |




Try using the following formula:
• Formula used in cell N2
Or, instead of using DROP( ) use TAKE( ) function.
Alternative approach without using LAMBDA( ) helper functions.
Another way, if you are not using
MS365then using INDEX() & AGGREGATE()