# Count consecutive cells above a certain value

#### Chrisscpu

##### New Member
I am trying to count the number of cells above a certain value in a table consecutively from right to left. I need it to stop counting if above 85%
 0.5 0.88 0.75 0.86 0.9 0.5 0.9 0.7 0.75 0.8 0.2 0.8 0.82 0.8 0.84

<tbody>
</tbody>

So for the above table, the correct response (in a column F not pictured) would be:
0 (1st value is above 85%)
3 (4th value is above 85%)
5 (none are above 85%)

I have been trying to amend the following formula with a ctrl, shift enter:
={IFERROR(COLUMN(P2)-COLUMN(INDEX(D2:P2,,MATCH(9.99E+307,IF(D2:P2=0,1,"")))),0)}

Any help is greatly appreciated, and if the above formula is not feasible with this issue, that's fine. I'll take anything that works. I have a feeling I'm overlooking something pretty basic.

### Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)

#### MarcelBeug

##### Well-known Member
In F2, copy down:
Code:
``=IFERROR(5-LOOKUP(2,1/(\$A2:\$E2>0.85),COLUMN(\$A2:\$E2)-COLUMN(\$A2)+1),5)``

#### Chrisscpu

##### New Member
Thank you very much. I had to adapt to a larger sheet, so if anyone wants to see the variables, here is for a 13 column chart starting at D.

=IFERROR(13-LOOKUP(2,1/(\$D2:\$P2>0.85),COLUMN(\$D2:\$P2)-COLUMN(\$D2)+1),13)

#### MarcelBeug

##### Well-known Member
You're welcome.

I deliberately provided an adaptable formula with COLUMN(\$A2:\$E2)-COLUMN(\$A2)+1 rather than {1, 2, 3, 4, 5}

Replies
5
Views
380
Replies
4
Views
474
Replies
8
Views
134
Replies
5
Views
350
Replies
0
Views
65

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

1,163,863
Messages
5,834,050
Members
430,259
Latest member
msthiagu

### We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.

### Which adblocker are you using?

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

### Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

### Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back