Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to calculate Min,Median,Max values in non consecutive rows via
Hi,
I would like to calculate the Min, Median and Max values in non consecutive rows via VBA. Year Value 2007 10 2007 20 2008 11 2009 12 2007 30 2008 25 2009 55 2008 26 2008 16 2009 40 I would like to represent the results as follows: 2007 Min = xxx Median = xxx Max = xxx 2008 Min = xxx Median = xxx Max = xxx 2009 Min = xxx Median = xxx Max = xxx Any idea what my code would look like? Pete. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to calculate Min,Median,Max values in non consecutive rows via
You can calculate your statistics (even non-consecutive) without any VBA:
=MAX(IF(A1:A10=2007,B1:B10,"")) =MIN(IF(A1:A10=2007,B1:B10,"")) =MEDIAN(IF(A1:A10=2007,B1:B10,"")) and will display: 30 10 20 These are array formulae. They must be entered with CNTRL-SHFT-ENTER rather than just the ENTER key. If you must use VBA, then use it to insert the equations! -- Gary''s Student - gsnu200844 "Pete" wrote: Hi, I would like to calculate the Min, Median and Max values in non consecutive rows via VBA. Year Value 2007 10 2007 20 2008 11 2009 12 2007 30 2008 25 2009 55 2008 26 2008 16 2009 40 I would like to represent the results as follows: 2007 Min = xxx Median = xxx Max = xxx 2008 Min = xxx Median = xxx Max = xxx 2009 Min = xxx Median = xxx Max = xxx Any idea what my code would look like? Pete. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Transposing data from consecutive rows into non-consecutive rows | Excel Discussion (Misc queries) | |||
How do I calculate the median of a distribution? | Excel Discussion (Misc queries) | |||
Calculate MEDIAN of Last x Rows in a Column | Excel Worksheet Functions | |||
Calculate median for different groups | Excel Discussion (Misc queries) | |||
Calculate top 100 values in non-consecutive rows | Excel Programming |