Average range changes formula

mhm

New Member
Joined
Mar 11, 2009
Messages
1
Hi There,
<link rel="File-List" href="file:///C:%5CUsers%5Cmcm%5CAppData%5CLocal%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml"><!--[if gte mso 9]><xml> <w:WordDocument> <w:View>Normal</w:View> <w:Zoom>0</w:Zoom> <w:PunctuationKerning/> <w:ValidateAgainstSchemas/> <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid> <w:IgnoreMixedContent>false</w:IgnoreMixedContent> <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText> <w:Compatibility> <w:BreakWrappedTables/> <w:SnapToGridInCell/> <w:WrapTextWithPunct/> <w:UseAsianBreakRules/> <w:DontGrowAutofit/> <w:UseFELayout/> </w:Compatibility> <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel> </w:WordDocument> </xml><![endif]--><!--[if gte mso 9]><xml> <w:LatentStyles DefLockedState="false" LatentStyleCount="156"> </w:LatentStyles> </xml><![endif]--><style> <!-- /* Font Definitions */ @font-face {font-family:"MS Mincho"; panose-1:2 2 6 9 4 2 5 8 3 4; mso-font-alt:"MS 明朝"; mso-font-charset:128; mso-generic-font-family:modern; mso-font-pitch:fixed; mso-font-signature:-536870145 1791491579 18 0 131231 0;} @font-face {font-family:"\@MS Mincho"; panose-1:2 2 6 9 4 2 5 8 3 4; mso-font-charset:128; mso-generic-font-family:modern; mso-font-pitch:fixed; mso-font-signature:-536870145 1791491579 18 0 131231 0;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-parent:""; margin:0cm; margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:12.0pt; font-family:"Times New Roman"; mso-fareast-font-family:"MS Mincho";} @page Section1 {size:595.3pt 841.9pt; margin:72.0pt 90.0pt 72.0pt 90.0pt; mso-header-margin:35.4pt; mso-footer-margin:35.4pt; mso-paper-source:0;} div.Section1 {page:Section1;} --> </style><!--[if gte mso 10]> <style> /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin:0cm; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman"; mso-fareast-font-family:"Times New Roman"; mso-ansi-language:#0400; mso-fareast-language:#0400; mso-bidi-language:#0400;} </style> <![endif]--> First of all apologies that this is rather a complicated question (even if the answer may be simple!)
<o:p> </o:p>
I have an extremely large data set (>560,000 rows).
<o:p> </o:p>
The first column contains sample data, which I require to calculate the average of (every nth number of samples).


See example below.


The range for the average calculation is dependent on the data in the second column, that is marked by a 1 or a 2 every few rows (however this spacing is not constant).
<o:p> </o:p>
I require the row number where the 1 or 2 is in the second column to be the mid-point of the average calculation of the data in the first column (with no overlap). Therefore the range for average calculation changes. Because of the massive data set, I require a formula that I can just fill down to make this dynamic calculation.
<o:p> </o:p>
I would be most grateful to anyone who can help.:)
Thanks,
Mike
<o:p> </o:p>
e.g. highly simplified example!
the first average calculation would be rows (1:5)
second rows (6:8)
third (9:15)
<o:p> </o:p>
<table class="MsoNormalTable" style="width: 144pt; margin-left: 4.65pt; border-collapse: collapse;" width="192" border="0" cellpadding="0" cellspacing="0"> <tbody><tr style="height: 12.75pt;"> <td style="border: 1pt solid windowtext; padding: 0cm 5.4pt; width: 48pt; height: 12.75pt;" valign="bottom" width="64" nowrap="nowrap">
Row<o:p></o:p>
</td> <td style="border-style: solid solid solid none; border-color: windowtext windowtext windowtext -moz-use-text-color; border-width: 1pt 1pt 1pt medium; padding: 0cm 5.4pt; width: 48pt; height: 12.75pt;" valign="bottom" width="64" nowrap="nowrap">
Data<o:p></o:p>
</td> <td style="border-style: solid solid solid none; border-color: windowtext windowtext windowtext -moz-use-text-color; border-width: 1pt 1pt 1pt medium; padding: 0cm 5.4pt; width: 48pt; height: 12.75pt;" valign="bottom" width="64" nowrap="nowrap">
Marker<o:p></o:p>
</td> </tr> <tr style="height: 12.75pt;"> <td style="border-style: none solid solid; border-color: -moz-use-text-color windowtext windowtext; border-width: medium 1pt 1pt; padding: 0cm 5.4pt; width: 48pt; height: 12.75pt;" valign="bottom" width="64" nowrap="nowrap">
1<o:p></o:p>
</td> <td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 48pt; height: 12.75pt;" valign="bottom" width="64" nowrap="nowrap">
0.492842<o:p></o:p>
</td> <td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 48pt; height: 12.75pt;" valign="bottom" width="64" nowrap="nowrap"> <o:p></o:p>
</td> </tr> <tr style="height: 12.75pt;"> <td style="border-style: none solid solid; border-color: -moz-use-text-color windowtext windowtext; border-width: medium 1pt 1pt; padding: 0cm 5.4pt; width: 48pt; height: 12.75pt;" valign="bottom" width="64" nowrap="nowrap">
2<o:p></o:p>
</td> <td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 48pt; height: 12.75pt;" valign="bottom" width="64" nowrap="nowrap">
0.070835<o:p></o:p>
</td> <td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 48pt; height: 12.75pt;" valign="bottom" width="64" nowrap="nowrap"> <o:p></o:p>
</td> </tr> <tr style="height: 12.75pt;"> <td style="border-style: none solid solid; border-color: -moz-use-text-color windowtext windowtext; border-width: medium 1pt 1pt; padding: 0cm 5.4pt; width: 48pt; height: 12.75pt;" valign="bottom" width="64" nowrap="nowrap">
3<o:p></o:p>
</td> <td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 48pt; height: 12.75pt;" valign="bottom" width="64" nowrap="nowrap">
0.377864<o:p></o:p>
</td> <td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 48pt; height: 12.75pt;" valign="bottom" width="64" nowrap="nowrap">
1<o:p></o:p>
</td> </tr> <tr style="height: 12.75pt;"> <td style="border-style: none solid solid; border-color: -moz-use-text-color windowtext windowtext; border-width: medium 1pt 1pt; padding: 0cm 5.4pt; width: 48pt; height: 12.75pt;" valign="bottom" width="64" nowrap="nowrap">
4<o:p></o:p>
</td> <td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 48pt; height: 12.75pt;" valign="bottom" width="64" nowrap="nowrap">
0.854413<o:p></o:p>
</td> <td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 48pt; height: 12.75pt;" valign="bottom" width="64" nowrap="nowrap"> <o:p></o:p>
</td> </tr> <tr style="height: 12.75pt;"> <td style="border-style: none solid solid; border-color: -moz-use-text-color windowtext windowtext; border-width: medium 1pt 1pt; padding: 0cm 5.4pt; width: 48pt; height: 12.75pt;" valign="bottom" width="64" nowrap="nowrap">
5<o:p></o:p>
</td> <td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 48pt; height: 12.75pt;" valign="bottom" width="64" nowrap="nowrap">
0.68555<o:p></o:p>
</td> <td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 48pt; height: 12.75pt;" valign="bottom" width="64" nowrap="nowrap"> <o:p></o:p>
</td> </tr> <tr style="height: 12.75pt;"> <td style="border-style: none solid solid; border-color: -moz-use-text-color windowtext windowtext; border-width: medium 1pt 1pt; padding: 0cm 5.4pt; width: 48pt; height: 12.75pt;" valign="bottom" width="64" nowrap="nowrap">
6<o:p></o:p>
</td> <td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 48pt; height: 12.75pt;" valign="bottom" width="64" nowrap="nowrap">
0.839349<o:p></o:p>
</td> <td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 48pt; height: 12.75pt;" valign="bottom" width="64" nowrap="nowrap"> <o:p></o:p>
</td> </tr> <tr style="height: 12.75pt;"> <td style="border-style: none solid solid; border-color: -moz-use-text-color windowtext windowtext; border-width: medium 1pt 1pt; padding: 0cm 5.4pt; width: 48pt; height: 12.75pt;" valign="bottom" width="64" nowrap="nowrap">
7<o:p></o:p>
</td> <td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 48pt; height: 12.75pt;" valign="bottom" width="64" nowrap="nowrap">
0.509461<o:p></o:p>
</td> <td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 48pt; height: 12.75pt;" valign="bottom" width="64" nowrap="nowrap">
2<o:p></o:p>
</td> </tr> <tr style="height: 12.75pt;"> <td style="border-style: none solid solid; border-color: -moz-use-text-color windowtext windowtext; border-width: medium 1pt 1pt; padding: 0cm 5.4pt; width: 48pt; height: 12.75pt;" valign="bottom" width="64" nowrap="nowrap">
8<o:p></o:p>
</td> <td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 48pt; height: 12.75pt;" valign="bottom" width="64" nowrap="nowrap">
0.15362<o:p></o:p>
</td> <td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 48pt; height: 12.75pt;" valign="bottom" width="64" nowrap="nowrap"> <o:p></o:p>
</td> </tr> <tr style="height: 12.75pt;"> <td style="border-style: none solid solid; border-color: -moz-use-text-color windowtext windowtext; border-width: medium 1pt 1pt; padding: 0cm 5.4pt; width: 48pt; height: 12.75pt;" valign="bottom" width="64" nowrap="nowrap">
9<o:p></o:p>
</td> <td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 48pt; height: 12.75pt;" valign="bottom" width="64" nowrap="nowrap">
0.893461<o:p></o:p>
</td> <td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 48pt; height: 12.75pt;" valign="bottom" width="64" nowrap="nowrap"> <o:p></o:p>
</td> </tr> <tr style="height: 12.75pt;"> <td style="border-style: none solid solid; border-color: -moz-use-text-color windowtext windowtext; border-width: medium 1pt 1pt; padding: 0cm 5.4pt; width: 48pt; height: 12.75pt;" valign="bottom" width="64" nowrap="nowrap">
10<o:p></o:p>
</td> <td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 48pt; height: 12.75pt;" valign="bottom" width="64" nowrap="nowrap">
0.553331<o:p></o:p>
</td> <td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 48pt; height: 12.75pt;" valign="bottom" width="64" nowrap="nowrap"> <o:p></o:p>
</td> </tr> <tr style="height: 12.75pt;"> <td style="border-style: none solid solid; border-color: -moz-use-text-color windowtext windowtext; border-width: medium 1pt 1pt; padding: 0cm 5.4pt; width: 48pt; height: 12.75pt;" valign="bottom" width="64" nowrap="nowrap">
11<o:p></o:p>
</td> <td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 48pt; height: 12.75pt;" valign="bottom" width="64" nowrap="nowrap">
0.764691<o:p></o:p>
</td> <td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 48pt; height: 12.75pt;" valign="bottom" width="64" nowrap="nowrap"> <o:p></o:p>
</td> </tr> <tr style="height: 12.75pt;"> <td style="border-style: none solid solid; border-color: -moz-use-text-color windowtext windowtext; border-width: medium 1pt 1pt; padding: 0cm 5.4pt; width: 48pt; height: 12.75pt;" valign="bottom" width="64" nowrap="nowrap">
12<o:p></o:p>
</td> <td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 48pt; height: 12.75pt;" valign="bottom" width="64" nowrap="nowrap">
0.892556<o:p></o:p>
</td> <td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 48pt; height: 12.75pt;" valign="bottom" width="64" nowrap="nowrap">
1<o:p></o:p>
</td> </tr> <tr style="height: 12.75pt;"> <td style="border-style: none solid solid; border-color: -moz-use-text-color windowtext windowtext; border-width: medium 1pt 1pt; padding: 0cm 5.4pt; width: 48pt; height: 12.75pt;" valign="bottom" width="64" nowrap="nowrap">
13<o:p></o:p>
</td> <td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 48pt; height: 12.75pt;" valign="bottom" width="64" nowrap="nowrap">
0.621487<o:p></o:p>
</td> <td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 48pt; height: 12.75pt;" valign="bottom" width="64" nowrap="nowrap"> <o:p></o:p>
</td> </tr> <tr style="height: 12.75pt;"> <td style="border-style: none solid solid; border-color: -moz-use-text-color windowtext windowtext; border-width: medium 1pt 1pt; padding: 0cm 5.4pt; width: 48pt; height: 12.75pt;" valign="bottom" width="64" nowrap="nowrap">
14<o:p></o:p>
</td> <td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 48pt; height: 12.75pt;" valign="bottom" width="64" nowrap="nowrap">
0.657257<o:p></o:p>
</td> <td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 48pt; height: 12.75pt;" valign="bottom" width="64" nowrap="nowrap"> <o:p></o:p>
</td> </tr> <tr style="height: 12.75pt;"> <td style="border-style: none solid solid; border-color: -moz-use-text-color windowtext windowtext; border-width: medium 1pt 1pt; padding: 0cm 5.4pt; width: 48pt; height: 12.75pt;" valign="bottom" width="64" nowrap="nowrap">
15<o:p></o:p>
</td> <td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 48pt; height: 12.75pt;" valign="bottom" width="64" nowrap="nowrap">
0.727103<o:p></o:p>
</td> <td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 48pt; height: 12.75pt;" valign="bottom" width="64" nowrap="nowrap"> <o:p></o:p>
</td> </tr> </tbody></table> <o:p> </o:p>
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.

Forum statistics

Threads
1,214,829
Messages
6,121,827
Members
449,051
Latest member
excelquestion515

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