Median formula to ignore blank cells

Hanz77

Board Regular
Joined
Sep 21, 2006
Messages
87
I'm trying to find the median on a range of numbers; however, the data is downloaded from another source and has the occasional blank cell. The Median formula automatically counts these blanks as zeros and skews my results. Following is my current formula and an example of the data I am using.

{=MEDIAN(IF(A1:A2000=15,B1:B2000))}

Column A contains random numbers ranging from 1 to 20. I am trying to get the median of all numbers in column B that has the number 15 in Column A. As originally stated, there are instances where there could be the number 15 in column A; however, the coresponding number in column B could be blank. I want this blank ignored and not counted as zero for my median amount. Also, I cannot delete the rows containing these blanks as there is additional data that I need in column C through M.

Any suggestions are appreciated.
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
How about:
Code:
=MEDIAN(IF(A1:A2000=15,IF(B1:B2000<>"",B1:B2000)))

Confirm with CTRL-SHIFT-ENTER
 
Upvote 0
Quick and dirty - sort your data on col B to bring all the blanks together, then modify your formula to exclude the rows containing blanks
 
Upvote 0

Forum statistics

Threads
1,214,585
Messages
6,120,391
Members
448,957
Latest member
Hat4Life

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top