COUNTIF formula counts the number of cells within a range based upon the single criteria/condition. It’s work similar to sumif function with the only change is that sumif function sums the numbers while countif count it.
In the above, we want to calculate the total number of employees attended the office, the total number of employees absent as well as employees on leave for the specific day.
Basic Formula for COUNTIF is = COUNTIF(Range,Criteria)
The formula in our case will be =COUNTIF($F$4:$F$23,”P”) where P=Present.
=COUNTIF($F$4:$F$23,”A”) where A=Absent
=COUNTIF($F$4:$F$23,”L”) where L=Leave
The final results will be as follows: