Highlighted
Contributor

# Median formula according to selected dates

What formula do I have to put into F2 (and F7, F12, F17 respectively) in order to find...

- Median of the First Reply (excluding 'null' results)

- The data F2 refers to is in accordance with the date range from B2:B3.

Here is the source where the formula could refer to the data.

4 Replies
Highlighted

# Re: Median formula according to selected dates

Do you mean by "median" that you want to calculate the date in the middle between the two dates in B2 and B3?

If so, the formula to put in F2 is =B2+((B3-B2)/2)

If not, please come back and clarify. ideally by posting your actual spreadsheet, not just an image of it.

Highlighted

# Re: Median formula according to selected dates

For the sample in attached file

formula could be

``=MEDIAN(IF((\$B\$2:\$B\$22>=\$E\$2)*(\$B\$2:\$B\$22<=\$F\$2),\$C\$2:\$C\$22,"null"))``

It is assumed in every cell of the range you have text ("null") or number. Function ignores all texts. It is assumed as well you have correct dates everywhere, not texts which represent the dates.

Highlighted

# Re: Median formula according to selected dates

Hello, Sergei. I tried the formula you suggested, but this warning came up. What should I do?

This data is transferred over to Google Sheets as I need to display it there. Is that why there's a null error?

Highlighted

# Re: Median formula according to selected dates

For Excel:

1) That is an array formula which shall be entered by Ctrl+Shift+Enter if only you are not on Excel with Dynamic Arrays

2) MEDIAN() ignores all texts in the range

Have no idea how it works in Google Sheets.