The problem is the blanks in column A. In F2, copied down:
=IF(A2="",F1,A2)
then
=MEDIAN(IF(ISNUMBER(SEARCH(G2,$C$2:$C$17)),IF($F$2:$F$17<>"Under Construction",$D$2:$D$17,"")))
and
=MEDIAN(IF(ISNUMBER(SEARCH(G5,$C$2:$C$17)),IF($F$2:$F$17<>"Under Construction",$D$2:$D$17,"")))
Both are array formulae.
Array Formulae are a little different from ordinary formulae in that they MUST be confirmed in the FIRST CELL ONLY by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. After that, the array can be dragged down as normal, to cover the desired range.
You will know the array is active when you see curly brackets { } - or "curly braces" for those of you in the USA, or "flower brackets" for those of you in India - appear around the outside of your formula. If you do not use CTRL+SHIFT+ENTER you will (almost always) get an error message or an incorrect answer. Press F2 on that cell and try again.
Don't type the curly brackets yourself - it won't work...
Bookmarks