That solves the failing aspect, however the ultimate goal is to have a count of document numbers that fit the text descriptions in the case statement. Using count on document number, and min/max of the formula text doesnt yield 2 rows for each possible text value.