Count rows where one column is filled and another is blank
=COUNTIFS(B2:B11,"<>",C2:C11,"")Excel · result on the sample sheet: 4
Describe what you need and get a working COUNTIFS formula for Excel and Google Sheets, tested on real data before you copy it. COUNTIFS counts the rows where every condition is true: orders that are from the East region and shipped, deals between $500 and $1,000.
Each formula below was calculated on its own sample sheet. Open one to see the sheet, why it works, and to try it yourself.
=COUNTIFS(B2:B11,"<>",C2:C11,"")Excel · result on the sample sheet: 4
=COUNTIFS(B2:B11,"<>0",B2:B11,"<>")Excel · result on the sample sheet: 5
=COUNTIFS(B2:B13,">="&F1,B2:B13,"<"&F2)Excel · result on the sample sheet: 5
=COUNTIFS($B$2:$B$9,B2,$C$2:$C$9,">"&C2)+1Excel · result on the sample sheet: 8 rows (D2:D9)
=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)
=COUNTIFS(A2:A8,">="&E1,A2:A8,"<"&E2+1)Excel · result on the sample sheet: 5
=FILTER(A2:C12,B2:B12=MAXIFS(B2:B12,A2:A12,A2:A12))Excel · result on the sample sheet: 4 rows (E2:G5)
=SORT(FILTER(A2:C11,B2:B11=MAXIFS(B2:B11,A2:A11,A2:A11)))Excel · result on the sample sheet: 4 rows (E2:G5)
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.
COUNTIFS counts the rows where every condition is true: orders that are from the East region and shipped, deals between $500 and $1,000.
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.