cuddling101
New Member
- Joined
- Feb 10, 2009
- Messages
- 34
I have read the threads about array formulas and I have tried that approach to my problem but it is not working for me. Even doing CSE on each cell and then F9 when data is changed is not working, so I gave up on that, and am now writing my own VBA.
I have the VBA function (Median_No_Zeroes) extract, by a rule, those cells that I want to produce a MEDIAN of and thus create an array, within the function, not a set of cells on the worksheet itself.
I then want to say f_Median = MEDIAN(A range of cells in my array, within the function, which I have named f_Gaps_Array)
I am just not sure of the syntax for that MEDIAN statement, would it be f_Median = MEDIAN(f_Gaps_Array(1:J)) or what, please?
The function would then return a single value to the worksheet with the following statement -
Median_No_Zeroes = f_median
I am using a function as I want to calculate this median on each new row of the spreadsheet that adds a value, to the range of values for which I am wanting the median, so the function will be called from multiple rows within the spreadsheet.
With thanks in anticipation
Philip
Bendigo, Victoria
I have the VBA function (Median_No_Zeroes) extract, by a rule, those cells that I want to produce a MEDIAN of and thus create an array, within the function, not a set of cells on the worksheet itself.
I then want to say f_Median = MEDIAN(A range of cells in my array, within the function, which I have named f_Gaps_Array)
I am just not sure of the syntax for that MEDIAN statement, would it be f_Median = MEDIAN(f_Gaps_Array(1:J)) or what, please?
The function would then return a single value to the worksheet with the following statement -
Median_No_Zeroes = f_median
I am using a function as I want to calculate this median on each new row of the spreadsheet that adds a value, to the range of values for which I am wanting the median, so the function will be called from multiple rows within the spreadsheet.
With thanks in anticipation
Philip
Bendigo, Victoria