Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Count consecutive excel cells where value is greater than 50 from left side only using excel formula

enter image description here
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.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>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
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading