Count unique rows grouped by two values in Excel using COUNTIFS or PivotTable with Data Model to avoid double-counting duplicates.