Hello,
I would like to ask for help on this issue.
I have a list of items and cost and I need to find the median for every set of item
example:
[TABLE="width: 500"]
<tbody>[TR]
[TD]item[/TD]
[TD]Cost[/TD]
[TD]Median[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]apple[/TD]
[TD]3[/TD]
[TD]apple[/TD]
[TD]3.75[/TD]
[/TR]
[TR]
[TD]apple[/TD]
[TD]2.8[/TD]
[TD]orange[/TD]
[TD]4.3[/TD]
[/TR]
[TR]
[TD]apple[/TD]
[TD]5.3[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]apple[/TD]
[TD]4.5[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]orange[/TD]
[TD]2.3[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]orange[/TD]
[TD]4.3[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]orange[/TD]
[TD]5.7[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]orange[/TD]
[TD]4.3[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]orange[/TD]
[TD]3.5[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]orange[/TD]
[TD]6.1[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]orange[/TD]
[TD]3.9[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
I am trying to do this in excel vba
how can I write the macro to find the median for each item?
I thought of a for loop but I am stuck when it comes to how to write the range so I will be dynamic
Any help is greatly appreciated!
I would like to ask for help on this issue.
I have a list of items and cost and I need to find the median for every set of item
example:
[TABLE="width: 500"]
<tbody>[TR]
[TD]item[/TD]
[TD]Cost[/TD]
[TD]Median[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]apple[/TD]
[TD]3[/TD]
[TD]apple[/TD]
[TD]3.75[/TD]
[/TR]
[TR]
[TD]apple[/TD]
[TD]2.8[/TD]
[TD]orange[/TD]
[TD]4.3[/TD]
[/TR]
[TR]
[TD]apple[/TD]
[TD]5.3[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]apple[/TD]
[TD]4.5[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]orange[/TD]
[TD]2.3[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]orange[/TD]
[TD]4.3[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]orange[/TD]
[TD]5.7[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]orange[/TD]
[TD]4.3[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]orange[/TD]
[TD]3.5[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]orange[/TD]
[TD]6.1[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]orange[/TD]
[TD]3.9[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
I am trying to do this in excel vba
how can I write the macro to find the median for each item?
I thought of a for loop but I am stuck when it comes to how to write the range so I will be dynamic
Any help is greatly appreciated!