Conditions · COUNTIF, COUNTIFS
COUNTIF in Excel - count cells that match (attendance P / A / L)
COUNTIF counts the cells in a range that match a value or condition. Great for attendance sheets.
=COUNTIF(range, criteria)Write it for my sheet
Examples
| Type this in the Formula Studio | Formula |
|---|---|
| “count P in C4:AG4” | =COUNTIF(C4:AG4,"P") |
| “count D2:D9 where D > 50000” | =COUNTIFS(D2:D9,">50000") |
| “count P and L in C4:AG4” | =COUNTIF(C4:AG4,"P")+COUNTIF(C4:AG4,"L") |
People also search for
FAQ
How do I count P and L together in an attendance row?
Add two COUNTIFs: =COUNTIF(C4:AG4,"P")+COUNTIF(C4:AG4,"L"). Or use =SUM(COUNTIF(C4:AG4,{"P","L"})).
How do I count cells that contain a word?
Use a wildcard: =COUNTIF(A2:A99,"*delhi*") counts cells containing 'delhi' anywhere. COUNTIF is not case-sensitive.
Can LoveByPDF write this formula for me?
Yes. Open your Excel file in the Excel Agent's Formula Studio, click a cell and type what you need - e.g. "count P in C4:AG4" - you get the formula, a preview on your sheet and an explanation, then insert it.
Related formulas
- IFIF formula in Excel - with examples in plain words
- IF (nested), AND, ORNested IF and IF with AND / OR in Excel
- IFERRORIFERROR in Excel - hide #DIV/0!, #N/A and other errors
- SUMIF, SUMIFSSUMIF and SUMIFS in Excel - add up with conditions
- SUMSUM formula in Excel - add up cells, rows and columns
- AVERAGEAVERAGE formula in Excel - the mean of a range
- COUNT, COUNTA, COUNTBLANKCOUNT vs COUNTA vs COUNTBLANK - counting cells in Excel
- MAX, MINMAX and MIN in Excel - highest and lowest value