Find average of a value occurring consecutively

worldCurrencies

New Member
Joined
Mar 7, 2022
Messages
17
Office Version
  1. 365
Platform
  1. Windows
I want to find the average of something occurring consecutively. For example, in Column A, I would have the array: {1,1,1,0,0,0,1,1,1,1,0,0,1,0}. I want to find that 1 occurred consecutively 3 times, and every time it occurred consecutively, it averaged to be consecutive for 2.6. I found this from (3+4+1) / 3.

How would I find this in excel?
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
If you're just dealing with 1s and 0s, try:

Book3
AB
112.666667
21
31
40
50
60
71
81
91
101
110
120
131
140
Sheet19
Cell Formulas
RangeFormula
B1B1=LET(a,FREQUENCY(IF(A1:A14>0,ROW(A1:A14)),IF(A1:A14=0,ROW(A1:A14))),AVERAGE(FILTER(a,a>0)))
 
Upvote 0
Solution

Forum statistics

Threads
1,214,383
Messages
6,119,198
Members
448,874
Latest member
Lancelots

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