logoalt Hacker News

stevesimmonstoday at 6:04 PM0 repliesview on HN

You can also use the =LET(...) formula to define named variables:

    =LET(
        filterCriteria, "Fred",
        filteredRange, FILTER(A2:D8,A2:A8=filterCriteria),
        IF(ISBLANK(filteredRange),"-", filteredRange)
    )
There must be an odd number 2D + 1 of arguments. The first 2D are D name-expression pairs and the final one is the expression whose value is returned.

The end result - as you see - is quite readable.