Forum Discussion
David_M1410
Oct 24, 2024Copper Contributor
Median of a column of all numbers in the column that are greater than zero
I have a column of 10 dollar amounts. A certain number of those cells are filled with dollars over zero; the remainder, if any, are always filled with zero dollars. How can I find the MEDIAN of onl...
- Oct 24, 2024
=MEDIAN( IF( A1:A10 > 0, A1:A10) )this assumes you run Excel >/= 2021 and A1:A10 contains Numbers only
David_M1410
Oct 24, 2024Copper Contributor
Wow, thank you. The formula works perfectly, EVEN if I don't put ">0" in the formula. I first tried =MEDIAN(IF(F:7:F16,F7:F16)), from the email I received, and it worked!! Then I signed in to the Excel Hub and saw the formula was: =MEDIAN(IF(F:7:F16>0,F7:F16)), which makes sense...and it WORKED ALSO. I wonder why both worked? But, thank you very much!
Lorenzo
Oct 24, 2024Silver Contributor
I wonder why both worked?
=MEDIAN( IF( F7:F16, F7:F16) )ignores zeros but not negative Numbers
=MEDIAN( IF( F7:F16 > 0, F7:F16 ) )ignores zeros and negative Numbers
I initially posted the 1st then revised it with the 2nd to be safe. If you don't work with negative numbers you can safely work with option 1