Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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. |
#2
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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. |
#3
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
ASSUMING (big assumption), that you only want to count the entries where the
second letter is an L, this is an arrya formula that you enter by pressing CTRL-SHIFT-ENTER =SUMPRODUCT(--(MID(A2:Z2,2,1)="L") "Gary" wrote: 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. |
#4
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
hey peo. that worked.
a little more help. now if I also want to add half day which is mentioned as H/D..but I dont want to count it as 1, I want to count it as .5 so if there is one CL and one H/D, the total should be 1.5 any idea? "Peo Sjoblom" wrote in message ... 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. |
#5
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
I would add a separate countif
=SUM(COUNTIF(A2:Z2,{"CL";"PL";"SL";"UL"}))+(COUNTI F(A2:Z2,"H/D")/2) -- Regards, Peo Sjoblom "Gary" wrote in message ... hey peo. that worked. a little more help. now if I also want to add half day which is mentioned as H/D..but I dont want to count it as 1, I want to count it as .5 so if there is one CL and one H/D, the total should be 1.5 any idea? "Peo Sjoblom" wrote in message ... 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. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Combine an OR condition with an AND condition | Excel Discussion (Misc queries) | |||
Condition 1 overules condition 2? | Excel Worksheet Functions | |||
Compound condition with COUNTIF | Excel Discussion (Misc queries) | |||
countif condition problem | Excel Worksheet Functions | |||
COUNTIF or not to COUNTIF on a range in another sheet | Excel Worksheet Functions |