
I am trying to count consecutive excel cells in a row where value is greater than 50 only from left side using excel formula.
For e.g – in 3rd row, there are consecutive 3 cells having values >50. However, counting from left, there are 2 cells with values >50 and then a value < 50. Hence, o/p will be 2 and not 3.
Expected output is in ‘count’ column.
>Solution :
=FIND("0", CONCAT(--(B1:E1>50))&"0")-1
This just changes the cell values into 1 (>50) and 0 (≤50), joins them all together into a string, slaps another 0 on the end, and then finds how many 1s there are before the first 0. This ensures that it only counts from the left-edge.
| Count | 26-Oct-2024 | 25-Oct-2024 | 24-Oct-2024 | 23-Oct-2024 |
|---|---|---|---|---|
| 1 | 52.38 | 40.3 | 50.39 | 46.32 |
| 3 | 52.94 | 50.04 | 50.82 | 47.53 |
| 2 | 53.06 | 51.39 | 35 | 65 |
| 3 | 53.48 | 50.68 | 50.69 | 47.64 |
| 1 | 53.48 | 47.64 | 50.68 | 50.69 |
| 0 | 47.64 | 53.48 | 50.68 | 50.69 |