Skip to main content

Excel formula builder

COUNTIFS Formula Builder

Count rows that match one, two, or three criteria with COUNTIFS. The builder runs in your browser and returns copyable Excel and Google Sheets formulas.

Builder inputs

Add criteria range and criteria value pairs. Keep ranges the same height; empty optional pairs are ignored.

First column to test, such as Status.
Text, number, operator criteria, or a cell reference.
Second column to test, such as Owner.
Leave both optional fields blank when not needed.
Use for an extra status, owner, category, or date condition.
Pairs with criteria range 3.

Formula is valid and ready to copy.

Excel formula
=COUNTIFS(C2:C100, "Complete", B2:B100, "Maya")
Google Sheets formula
=COUNTIFS(C2:C100, "Complete", B2:B100, "Maya")
Explanation
COUNTIFS uses paired criteria range and criteria value arguments.

How this formula works

  • COUNTIFS counts rows only when every criteria pair is true.
  • Text criteria are quoted automatically.
  • Criteria can also use operators such as >=100 or <>Closed.

Best fit

Best for

  • Counting matching rows by status, owner, category, month, or date range.
  • Dashboard tiles such as completed tasks, overdue items, or transactions this month.
  • Checking how many rows meet several criteria without adding a numeric amount column.

Not for

  • Adding values from an amount column. Use SUMIFS when you need a total.
  • Returning the actual rows. Use FILTER or QUERY when you need a filtered list.
  • Counting distinct values. Use the Count Unique builder for unique names, IDs, or categories.

Useful formula variations

Count rows by status
=COUNTIFS(C2:C100, "Complete")

Use one criteria pair when you only need a simple status count.

COUNTIFS by month
=COUNTIFS(A2:A100, ">="&DATE(YEAR(F1),MONTH(F1),1), A2:A100, "<"&EOMONTH(F1,0)+1)

Use this when column A contains real dates and F1 contains any date in the target month.

COUNTIFS between two date cells
=COUNTIFS(A2:A100, ">="&F1, A2:A100, "<"&G1)

Use an exclusive upper boundary when source rows can include time values.

Sample data

TaskOwnerStatusDue Date
Import leadsMayaComplete2026-01-06
Clean headersNicoIn Progress2026-01-08
Review budgetMayaComplete2026-01-12
Publish reportIrisBlocked2026-01-15

Returned counts from the sample data

Criteria setupReturned countRows included
Status = Complete and Owner = Maya2Import leads and Review budget.
Status = In Progress1Clean headers.
Due Date in January 20264All four sample tasks are due in January 2026.

Builder field guide

FieldUse it forExample
Criteria range 1The first column to testC2:C100 for Status
Criteria value 1The first required matchComplete or F2
Criteria range 2 optionalA second column to testB2:B100 for Owner
Criteria range 3 optionalDate, category, or priority checksD2:D100 with ">=2026-01-01"

Troubleshooting

ProblemLikely causeFix
COUNTIFS returns 0The criteria does not match exact source values or the dates are stored as text.Check source spelling, hidden spaces, and whether date cells are real dates.
#VALUE! appearsCriteria ranges do not have matching sizes.Use ranges with the same number of rows, such as A2:A100 and C2:C100.
A count looks like a totalCOUNTIFS counts rows and never adds amounts.Switch to SUMIFS when you need to total the Amount column.

Common mistakes

  • Every criteria range must have the same number of rows.
  • COUNTIFS is for row counts, not sums. Use SUMIFS when you need to add values.
  • Blank criteria fields should be removed instead of leaving an empty range/value pair.

Related formulas

FAQ

Does this build Excel and Google Sheets formulas?

Yes. The COUNTIFS syntax generated here works in both Excel and Google Sheets for normal criteria pairs.

Why does COUNTIFS return #VALUE?

The most common cause is mismatched criteria range sizes. Use ranges with the same number of rows, such as B2:B100 and C2:C100.

Can I count rows by month with this builder?

Use the COUNTIFS by month variation when your date column contains real spreadsheet dates and your month selector is a real date cell.

Should I use COUNTIFS or SUMIFS?

Use COUNTIFS when you need a row count. Use SUMIFS when you need to add amounts, hours, revenue, or other numeric values.

Are these formulas generated with AI?

No. The builder uses built-in spreadsheet rules in your browser and does not call an AI service.

Do I need to upload my spreadsheet?

No. Enter ranges and criteria manually. The site does not upload, store, or process spreadsheet files.