Using both a Median and If condition is including blank cells as zero. How to fix?

RobbieJ2412

New Member
Joined
Jul 1, 2022
Messages
2
Office Version
  1. 2019
Platform
  1. Windows
Hello,

I am trying to find the median of a set of numbers if they equal a certain condition. When I do this the median includes the blank cells as zero and is pulling my median numbers lower than they should be
Is there a way to ignore these in this formula or an alternative i could use?

Here is the formula I am using

=MEDIAN(IF(AE3:AE22="a",AS3:AS22))

Thanks
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
Hi & welcome to MrExcel.
How about
Excel Formula:
=MEDIAN(IF((AE3:AE22="a")*(AS3:AS22<>0),AS3:AS22))
 
Upvote 0
Hi & welcome to MrExcel.
How about
Excel Formula:
=MEDIAN(IF((AE3:AE22="a")*(AS3:AS22<>0),AS3:AS22))
Great thanks that has worked

I am also looking to use something similar for COUNTA

I want to count the number of cells in AS3:AS22 which are not blank but also satisfy the condition (AE3AE22="a")
Is there a way to do so?

Thanks
 
Upvote 0
You can use the countifs function for that. If you need help with it, you will need to start a new thread.
 
Upvote 0

Forum statistics

Threads
1,215,709
Messages
6,126,383
Members
449,311
Latest member
accessbob

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