Median across with multiple columns and criteria

richtks

New Member
Joined
Jun 1, 2019
Messages
20
Office Version
  1. 365
Platform
  1. Windows
Is this possible? I need to figure the median based on market and construction status.

Below is an example. I need the median of multiple project's, in multiple markets for Days in Construction Start (CXs) to today and Days CXs to On Air (OA) based on the On-Air Status (s) being "P".

1718052172564.png


in turn, I'll need to do the same for completed project which equal "A" in the On Air S.
***Side note... I already have a pivot where I was averaging the days, but extended projects seems to drive up those numbers in markets that are not as busy as others.***
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
Perhaps like this?

You haven't indicated which version of Excel you are using, but if you are using Excel 2019 or earlier then these need to be entered as array formulas (CTRL+SHIFT+ENTER).

Book1
AOPQRSBHBIBJBKBLBM
1Count to TodayCount to ProjectedOn air statusTypeMedian
26186PCount to Today51.5
34260PCount to Projected73
4145156P
53438P
Sheet2
Cell Formulas
RangeFormula
BM2BM2=MEDIAN(IF(BI$2:BI$5="P",P$2:P$5))
BM3BM3=MEDIAN(IF(BI$2:BI$5="P",Q$2:Q$5))
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
Perhaps like this?

You haven't indicated which version of Excel you are using, but if you are using Excel 2019 or earlier then these need to be entered as array formulas (CTRL+SHIFT+ENTER).

Book1
AOPQRSBHBIBJBKBLBM
1Count to TodayCount to ProjectedOn air statusTypeMedian
26186PCount to Today51.5
34260PCount to Projected73
4145156P
53438P
Sheet2
Cell Formulas
RangeFormula
BM2BM2=MEDIAN(IF(BI$2:BI$5="P",P$2:P$5))
BM3BM3=MEDIAN(IF(BI$2:BI$5="P",Q$2:Q$5))
Press CTRL+SHIFT+ENTER to enter array formulas.

I am using 365 and have updated my profile.

Thank you for your input. I need to be able to break it down by market (12 in total) if possible.

I expanded on your formula a bit, but come up with a #VALUE! error:

=MEDIAN(IFS([@Market],Details[Market Combined],Details[On-Air S]="P",Details[Current Days Count CXs to Today]))
 
Upvote 0
Without a sample of your data, and especially since the formula is now in table form, it's impossible to tell. A #VALUE! error generally indicates that a value is missing or text is encountered where a number is expected.
I'd suggest testing your modified formula on a small (5-10 records) subset of your original data before transferring it to a larger table.
 
Upvote 0

Forum statistics

Threads
1,224,548
Messages
6,179,451
Members
452,915
Latest member
hannnahheileen

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