Av & Median formula

GMD1975

Board Regular
Joined
Sep 16, 2011
Messages
112
Office Version
  1. 365
Hi,

I need to analyse a large data source to find the average and median values of certain items.</SPAN></SPAN>

I’ve put together an example below that illustrates what I need to do. </SPAN></SPAN>

I need a formula in E2 that calculates the average number in B2:B21 where column A2:A21 =’s E1 [Apple] ie The average of 200</SPAN></SPAN>

I need also need a formula in E3 that calculates the median number in B2:B21 where column A2:A21 =’s E1 [Apple]</SPAN></SPAN>

Can anyone help me please?</SPAN></SPAN>

[TABLE="width: 321"]
<TBODY>[TR]
[TD] [/TD]
[TD]A</SPAN>[/TD]
[TD]B</SPAN>[/TD]
[TD]C</SPAN>[/TD]
[TD]D</SPAN>[/TD]
[TD]E</SPAN>[/TD]
[/TR]
[TR]
[TD]1</SPAN>[/TD]
[TD]Fruit</SPAN>[/TD]
[TD]Bites</SPAN>[/TD]
[TD] [/TD]
[TD] [/TD]
[TD]Apple</SPAN>[/TD]
[/TR]
[TR]
[TD]2</SPAN>[/TD]
[TD]Apple</SPAN>[/TD]
[TD]50</SPAN>[/TD]
[TD] [/TD]
[TD]Av</SPAN>[/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]3</SPAN>[/TD]
[TD]Pear</SPAN>[/TD]
[TD]40</SPAN>[/TD]
[TD] [/TD]
[TD]Median</SPAN>[/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]4</SPAN>[/TD]
[TD]Plumb</SPAN>[/TD]
[TD]30</SPAN>[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]5</SPAN>[/TD]
[TD]Orange</SPAN>[/TD]
[TD]20</SPAN>[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]6</SPAN>[/TD]
[TD]Cherry</SPAN>[/TD]
[TD]10</SPAN>[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]7</SPAN>[/TD]
[TD]Apple</SPAN>[/TD]
[TD]50</SPAN>[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]8</SPAN>[/TD]
[TD]Pear</SPAN>[/TD]
[TD]40</SPAN>[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]9</SPAN>[/TD]
[TD]Plumb</SPAN>[/TD]
[TD]30</SPAN>[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]10</SPAN>[/TD]
[TD]Orange</SPAN>[/TD]
[TD]20</SPAN>[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]11</SPAN>[/TD]
[TD]Cherry</SPAN>[/TD]
[TD]10</SPAN>[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]12</SPAN>[/TD]
[TD]Apple</SPAN>[/TD]
[TD]50</SPAN>[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]13</SPAN>[/TD]
[TD]Pear</SPAN>[/TD]
[TD]40</SPAN>[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]14</SPAN>[/TD]
[TD]Plumb</SPAN>[/TD]
[TD]30</SPAN>[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]15</SPAN>[/TD]
[TD]Orange</SPAN>[/TD]
[TD]20</SPAN>[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]16</SPAN>[/TD]
[TD]Cherry</SPAN>[/TD]
[TD]10</SPAN>[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]17</SPAN>[/TD]
[TD]Apple</SPAN>[/TD]
[TD]50</SPAN>[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]18</SPAN>[/TD]
[TD]Pear</SPAN>[/TD]
[TD]40</SPAN>[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]19</SPAN>[/TD]
[TD]Plumb</SPAN>[/TD]
[TD]30</SPAN>[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]20</SPAN>[/TD]
[TD]Orange</SPAN>[/TD]
[TD]20</SPAN>[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]21</SPAN>[/TD]
[TD]Cherry</SPAN>[/TD]
[TD]10</SPAN>[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
</TBODY><COLGROUP><COL><COL span=2><COL><COL span=2></COLGROUP>[/TABLE]
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
Hi,

I need to analyse a large data source to find the average and median values of certain items.

I’ve put together an example below that illustrates what I need to do.

I need a formula in E2 that calculates the average number in B2:B21 where column A2:A21 =’s E1 [Apple] ie The average of 200

I need also need a formula in E3 that calculates the median number in B2:B21 where column A2:A21 =’s E1 [Apple]

Can anyone help me please?

[TABLE="width: 321"]
[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Fruit[/TD]
[TD]Bites[/TD]
[TD][/TD]
[TD][/TD]
[TD]Apple[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]Apple[/TD]
[TD]50[/TD]
[TD][/TD]
[TD]Av[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]Pear[/TD]
[TD]40[/TD]
[TD][/TD]
[TD]Median[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]Plumb[/TD]
[TD]30[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]Orange[/T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b[/TD]
[TD]30[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]20[/TD]
[TD]Orange[/TD]
[TD]20[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]21[/TD]
[TD]Cherry[/TD]
[TD]10[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[/TABLE]

Excel Workbook
ABCDEF
1FruitBitesApple
2Apple50Excel 07/10Excel 03
3Pear40Av5050
4Plumb30Median5050
5Orange20
6Cherry10
7Apple50
8Pear40
9Plumb30
10Orange20
11Cherry10
12Apple50
13Pear40
14Plumb30
15Orange20
16Cherry10
17Apple50
18Pear40
19Plumb30
20Orange20
21Cherry10
Sheet6
 
Upvote 0

Forum statistics

Threads
1,223,239
Messages
6,170,947
Members
452,368
Latest member
jayp2104

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