Finding consecutive numbers and then taking average of middle 50%

gmcgough600

New Member
Joined
Nov 21, 2017
Messages
32
In the table below the first column is my data, the second and third are what I want. Any ideas how to do this would be really appreciated.:biggrin: Basically I want to find consecutive blocks of 4 or more numbers within the #N/As and copy these. I then want to use TRIMMEAN on each block to trim 50% (calculate mean excluding 50% of the points) and put the result somewhere e.g. in the first cell of each block.
What I haveWhat I want a formula to do (step 1)What I want a formula to do (step 2)
#N/A#N/A#N/A
#N/A#N/A#N/A
#N/A#N/A#N/A
#N/A#N/A#N/A
112.5
22#N/A
33#N/A
44#N/A
#N/A#N/A#N/A
#N/A#N/A#N/A
1#N/A#N/A
1#N/A#N/A
#N/A#N/A#N/A
666
66#N/A
66#N/A
55#N/A
#N/A#N/A#N/A

<tbody>
</tbody>
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
Welcome to the board.

I found it easier to jump right to step 2.

Excel 2012
ABCDE
1What I haveWhat I want a formula to do (step 1)What I want a formula to do (step 2)
2#N/A#N/A#N/A#N/A
3#N/A#N/A#N/A#N/A
4#N/A#N/A#N/A#N/A
5#N/A#N/A#N/A#N/A
6112.52.5
722#N/A#N/A
833#N/A#N/A
944#N/A#N/A
10#N/A#N/A#N/A#N/A
11#N/A#N/A#N/A#N/A
121#N/A#N/A#N/A
131#N/A#N/A#N/A
14#N/A#N/A#N/A#N/A
156666
1666#N/A#N/A
1766#N/A#N/A
1855#N/A#N/A
19#N/A#N/A#N/A#N/A

<colgroup><col style="width: 25pxpx"><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet1

Array Formulas
CellFormula
E2{=IF(A2="#N/A",NA(),IF(ISNUMBER(A1),NA(),IF(MATCH(1,ISNA(A2:A$19)+0,0)-1<4,NA(),TRIMMEAN(OFFSET(A2,0,0,MATCH(1,ISNA(A2:A$19)+0,0)-1),50%))))}

<thead>
</thead><tbody>
</tbody>
Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}.
Note: Do not try and enter the {} manually yourself

<tbody>
</tbody>



This is an array formula. Enter the formula into the formula bar, change the ranges to match your sheet, then press Control+Shift+Enter, not just Enter. Let us know how it works.
 
Upvote 0

Forum statistics

Threads
1,214,924
Messages
6,122,293
Members
449,077
Latest member
Rkmenon

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