You mean delete the values from the cells? What if there are duplicates,
should duplicate Mins or Maxes be removed as well?
One way, using a macro:
Public Sub RemoveMaxMin()
Dim rCell As Range
Dim dMax As Double
Dim dMin As Double
With Selection
dMax = Application.Max(.Cells)
dMin = Application.Min(.Cells)
For Each rCell In .Cells
With rCell
If IsNumeric(.Value) Then _
If .Value = dMax Or .Value = dMin Then .ClearContents
End With
Next rCell
End With
End Sub
Thanks a lot; I actually did want calculate an average and ignore the
extremes (as a primitive statistical approach to 'smoothening' a graph).
Your answer makes it clear.
If the intention is to eliminate all max and all min values (they
might appear more than once):
=TRIMMEAN(A:A,(COUNTIF(A:A,MAX(A:A))+COUNTIF(A:A,MIN(A:A)))/
COUNT(A:A))
Thanks! This is even better.
Amazing to see that this is apparently a standard operation. In my
statistical ignorance I seem to have reinvented it.
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.