Duplicate finder hangs

To Find Invalid Categories on Transactions Sheet, use the following formula in a spare sheet cell with rows open below it.

=SORT(UNIQUE(IFNA(FILTER(INDIRECT("Transactions!$D$2:$D"),ISNA(XMATCH(INDIRECT("Transactions!$D$2:$D"),INDIRECT("Categories!$A$2:$A"))),INDIRECT("Transactions!$D$2:$D")<>""))))

Where Transactions D and Categories A are the Category columns of each sheet, respectively. Change these column letters in the formulas to match your spreadsheet, if they are different.