Explanation

A common situation in Excel is to use theSORT functionto sort results returned by theFILTER function.

However, a formula based on the FILTER and SORT may return an error when no data is returned.

Problem

The formula below returns a #CALC!

Example of #CALC! error with FILTER and SORT

The first cell contains “No data” and the second cell is empty.

The output from FILTER is dynamic.

If source data or criteria change, FILTER will return a new set of results.

Example of #CALC! error with FILTER and SORT

Values can be sorted by one or more columns.

SORT returns a dynamic array of results.

Example of #CALC! error with FILTER and SORT

Example of #CALC! error with FILTER and SORT

Example of #CALC! error with FILTER and SORT

Example of #VALUE! error with FILTER and SORT

Example of FILTER and SORT without errors

Excel FILTER function

Excel SORT function

Example of #CALC! error with FILTER and SORT

Example of #VALUE! error with FILTER and SORT

Example of FILTER and SORT without errors