Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to loop through the data to find the median?
I have the following spreadsheet. I would like to find the median for
Column B for the associated item in A. For example, for Item 1, get median(B1:B12); for Item 2, median(B13:B17); Item 3, median(b18:b20) etc. Is there an example to do this using VBA? Thanks. A B = ==== 1 1 154000 2 1 556000 3 1 195000 4 1 135000 5 1 154500 6 1 109896 7 1 172000 8 1 250000 9 1 162500 10 1 120000 11 1 100000 12 1 125000 13 2 126000 14 2 167565 15 2 125000 16 2 150000 17 2 90000 18 3 128648 19 3 148740 20 3 125000 21 4 104280 22 4 71500 23 4 109555 24 4 121000 25 4 132720 26 4 114600 27 4 84150 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to loop through the data to find the median?
You could do this with an array formula:
In C1 enter the value in column A you want to find the median of column B In D1 enter the following array formula: =MEDIAN(IF(A1:A27=C1,B1:B27,FALSE)) The array formula must be entered with ctrl+shift+enter. fl wrote: I have the following spreadsheet. I would like to find the median for Column B for the associated item in A. For example, for Item 1, get median(B1:B12); for Item 2, median(B13:B17); Item 3, median(b18:b20) etc. Is there an example to do this using VBA? Thanks. A B = ==== 1 1 154000 2 1 556000 3 1 195000 4 1 135000 5 1 154500 6 1 109896 7 1 172000 8 1 250000 9 1 162500 10 1 120000 11 1 100000 12 1 125000 13 2 126000 14 2 167565 15 2 125000 16 2 150000 17 2 90000 18 3 128648 19 3 148740 20 3 125000 21 4 104280 22 4 71500 23 4 109555 24 4 121000 25 4 132720 26 4 114600 27 4 84150 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How can I find a median? | Excel Discussion (Misc queries) | |||
Find loop doesn't loop | Excel Discussion (Misc queries) | |||
find for non zero values in a column Median,Mode,STDEV | Excel Worksheet Functions | |||
Find the median 3 values | Excel Discussion (Misc queries) | |||
Find Median of Positive numbers only in Range | Excel Worksheet Functions |