View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Peo Sjoblom Peo Sjoblom is offline
external usenet poster
 
Posts: 3,268
Default COUNTIF - more than one condition

Try

=SUM(COUNTIF(A2:Z2,{"CL";"PL";"SL";"UL"}))



--
Regards,

Peo Sjoblom



"Gary" wrote in message
...
Hi All,

I have to count Casual Leaves, Sick Leaves, Privilege Leaves and
Unscheduled Leaves for an employee. In the attendance sheet, they're
marked as CL, SL, PL, UL.

Now how do I get a count of all the leaves with just one formula. Right
now I am using this.
=COUNTIF(A2:Z2,"CL")+COUNTIF(A2:Z2,"SL")+COUNTIF(A 2:Z2,"PL")+COUNTIF(A2:Z2,"UL")

Is there an easier way? like multiple conditions with just one COUNTIF?

Thanks
Gary.