# COUNTIFS formula generator

> Describe what you need and get a COUNTIFS formula for Excel and Google Sheets, run on real data before you copy it. Plus 8 tested COUNTIFS examples.

Source: https://spreadsheetpractice.com/tools/formula-generator/countifs · Updated October 29, 2026 · Formulas and results on this page were run by the Spreadsheet Practice formula engine on November 20, 2026

COUNTIFS counts the rows where every condition is true: orders that are from the East region and shipped, deals between $500 and $1,000.

Describe the task at [COUNTIFS formula generator](https://spreadsheetpractice.com/tools/formula-generator/countifs) and get a COUNTIFS formula for Excel and Google Sheets, tested on real data.

## Tested COUNTIFS examples

### Count rows where one column is filled and another is blank

`=COUNTIFS(B2:B11,"<>",C2:C11,"")`

Excel. Result on the sample sheet: 4. [See it and try it](https://spreadsheetpractice.com/formulas/count-rows-where-one-column-is-filled-and-another-is-blank)

### Count non-zero values

`=COUNTIFS(B2:B11,"<>0",B2:B11,"<>")`

Excel. Result on the sample sheet: 5. [See it and try it](https://spreadsheetpractice.com/formulas/count-non-zero-values)

### Count times between two times

`=COUNTIFS(B2:B13,">="&F1,B2:B13,"<"&F2)`

Excel. Result on the sample sheet: 5. [See it and try it](https://spreadsheetpractice.com/formulas/count-times-between-two-times)

### Rank within groups

`=COUNTIFS($B$2:$B$9,B2,$C$2:$C$9,">"&C2)+1`

Excel. Result on the sample sheet: 8 rows (D2:D9). [See it and try it](https://spreadsheetpractice.com/formulas/rank-within-groups)

### Calculate the percentage within each group using COUNTIFS

`=COUNTIFS($B$2:$B$13,E2,$C$2:$C$13,"Remote")/COUNTIF($B$2:$B$13,E2)`

Excel. Result on the sample sheet: 3 rows (F2:F4). [See it and try it](https://spreadsheetpractice.com/formulas/percentage-within-each-group)

### Why does COUNTIFS miss the last day of a date range

`=COUNTIFS(A2:A8,">="&E1,A2:A8,"<"&E2+1)`

Excel. Result on the sample sheet: 5. [See it and try it](https://spreadsheetpractice.com/formulas/countifs-misses-last-day-of-date-range)

### Get the latest record for each customer

`=FILTER(A2:C12,B2:B12=MAXIFS(B2:B12,A2:A12,A2:A12))`

Excel. Result on the sample sheet: 4 rows (E2:G5). [See it and try it](https://spreadsheetpractice.com/formulas/latest-record-for-each-customer)

### Get the most recent entry for every customer

`=SORT(FILTER(A2:C11,B2:B11=MAXIFS(B2:B11,A2:A11,A2:A11)))`

Excel. Result on the sample sheet: 4 rows (E2:G5). [See it and try it](https://spreadsheetpractice.com/formulas/latest-entry-for-every-customer)

## Questions

### What does the COUNTIFS formula generator do?

You describe the task in plain English, and it writes the formula, using COUNTIFS where that's the right tool, for your table or a sample one. The formula is run in our engine in Excel and Google Sheets mode before you see it, so you get its result, not just a guess.

### What does COUNTIFS do?

COUNTIFS counts the rows where every condition is true: orders that are from the East region and shipped, deals between $500 and $1,000.

### Can I learn to write COUNTIFS formulas myself?

Yes. Each example below opens a page where you try the formula in a live grid and it's checked as you go, and the COUNTIFS function page has a practice exercise.

---

Spreadsheet Practice (https://spreadsheetpractice.com) teaches spreadsheet formulas by practice: every exercise is graded in a live grid and re-checked on changed data.
