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

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.

Scott Huish

MrExcel MVP
Joined
Mar 17, 2004
Messages
19,961
Office Version
  1. 365
Platform
  1. Windows
How about:
Code:
=MEDIAN(IF(A1:A2000=15,IF(B1:B2000<>"",B1:B2000)))

Confirm with CTRL-SHIFT-ENTER
 
Upvote 0

Gerald Higgins

Well-known Member
Joined
Mar 26, 2007
Messages
9,258
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,186,911
Messages
5,960,543
Members
438,483
Latest member
Shahin Jack

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
Top