The function filter can be use to dynamically filter a range of cells.

This function is only available for Microsoft 365

Syntax:

=Filter ( range of cells, logical function)

Range of Cells. Is the range of cells to filter.

Logical function. Is the array and logical function to be used to select the values to retain