Enhanced Version of Excel's COUNTIF formula