That formula looks like it should be an Array formula, use Ctrl-Shift to enter