Count occurrence of specific value in a list, upwardly of given number

ibmy

Board Regular
Joined
Mar 4, 2020
Messages
134
Office Version
  1. 2016
Platform
  1. Windows
Hi,

Specific Value = 0.1
5.17.xlsb
BCD
1DataNumberResult
20.4
30.1
40.2
50.132
60.5
70.111
80.5
90.1
100.2
110.2
120.1
130.1
140.3
150.1
160.284
170.9
to ask
Description:
1. C5 number is 3, so count 0.1 in B5,B4,B3
2. C7 number is 1, so just count 0.1 in B7 only
3. C16 number is 8, so count 0.1 from B16 -> B9

No count if there is a blank cell in Column C.

Table above is sample of 65k row data.
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
Excel Formula:
=IF(ISBLANK(B2),"",COUNTIF(OFFSET(A2,-B2,):A2,0.1))
 
Upvote 0
Solution
Another option
Fluff.xlsm
BCD
1DataNumberResult
20.4 
30.1 
40.2 
50.132
60.5 
70.111
80.5 
90.1 
100.2 
110.2 
120.1 
130.1 
140.3 
150.1 
160.284
170.9
Main
Cell Formulas
RangeFormula
D2:D16D2=IF(C2="","",COUNTIFS(INDEX(B:B,ROWS(D$2:D2)-C2+1):B2,0.1))
 
Upvote 0
@Fluff This was off a column, maybe an xlbb thing
1661950926306.png

1.
Excel Formula:
=IF(C2="","",COUNTIFS(INDEX(B:B,ROWS(D$2:D2)-C2+1):B2,0.1))
2.
Excel Formula:
=IF(B2="","",COUNTIFS(INDEX(A:A,ROWS(C$2:C2)-B2+1):A2,0.1))
 
Upvote 0
No it's not off if you look at both the mini-sheet provided by the OP & mine, you will see that it starts in B1. That is one of good things about the XL2BB add-in, as you can see which cells are which.
 
Upvote 0
Ah okay, I was going off of what I put down yesterday (which was off). the addin doesn't work on my work computer, never used it and just started here. Didn't see that.
 
Upvote 0

Forum statistics

Threads
1,224,737
Messages
6,180,655
Members
452,992
Latest member
TokugawaIesuma

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.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

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

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

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
Back
Top