Jump to content

Worksheet Spreadsheet Median Function?


Recommended Posts

21 minutes ago, Bruce Kieffer said:

I have three parameters, and it's possible that some of the three may be the same value. I think that could be a problem.

That shouldn’t be a problem.

just sort the list and take the middle value if the list length is odd. Take the average of the 2 middle values if the list length is even.

Will the data come from a region of cells? Or will it just be input in the formula?


If your goal is to get the median from a database row calculation, you might try to put the worksheet script outside database header and point to the database rows. Worth trying. 

Link to comment
1 hour ago, Peter Vandewalle said:

That shouldn’t be a problem.

just sort the list and take the middle value if the list length is odd. Take the average of the 2 middle values if the list length is even.

Will the data come from a region of cells? Or will it just be input in the formula?


If your goal is to get the median from a database row calculation, you might try to put the worksheet script outside database header and point to the database rows. Worth trying. 

I'm trying something like that, but I trying to use a formula to choose which is the median value. So far no luck with a formula.

Link to comment

It is certainly scriptable, I just meant that there is no function for returning the value built in.

 

If you only have three numbers then the median is Sum(3 values)-Min-Max. This does not care if two of the values are the same.

 

It really depends on what you use of the median value is if this algorithm works for you or not.

 

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...