Excel → T-SQL › COUNTIFS

COUNTIFS to SQL WHERE with AND

COUNTIFS is one COUNT with every test in the WHERE (or in the CASE).

SELECT COUNT(*)
FROM Orders
WHERE status = 'Shipped'
  AND order_date >= '2026-01-01';

Do not write two COUNTs and subtract. One pass.

Canonical translation

SELECT COUNT(*)
FROM Orders
WHERE status = 'Shipped'
  AND order_date >= '2026-01-01';

Then write it on a ticket

Monday is free. A colleague asks, you type, we mark it.

Clock in free