Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
xl2003
I am trying to count the number of instances in range L7:Q12 in which the L cell is < 0 and the Q cell <= 4, as in A = Application.WorksheetFunction.CountIf(.Range("L7:L 12"), "< 0") B = Application.WorksheetFunction.CountIf(.Range("Q7:Q 12"), "< = 4") I am trying to 'combine' the above 2 functions like you can in excel, as in A = Application.WorksheetFunction.CountIf(CountIf(.Ran ge("L7:L12"), "< 0"),CountIf(.Range("Q7:Q12"), "<= 4")) but is does not like the first CountIf. Any help would be greatly appreciated Ta, Martin |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am trying to 'combine' the above 2 functions like you can in excel
I think you are remembering something that isn't true. =Sumproduct(--(L7:L12<0),--(Q7:Q12<=4)) in code A = Evaluate("Sumproduct(--(L7:L12<0),--(Q7:Q12<=4))") -- Regards, Tom Ogilvy "Martin Wheeler" wrote in message ... xl2003 I am trying to count the number of instances in range L7:Q12 in which the L cell is < 0 and the Q cell <= 4, as in A = Application.WorksheetFunction.CountIf(.Range("L7:L 12"), "< 0") B = Application.WorksheetFunction.CountIf(.Range("Q7:Q 12"), "< = 4") I am trying to 'combine' the above 2 functions like you can in excel, as in A = Application.WorksheetFunction.CountIf(CountIf(.Ran ge("L7:L12"), "< 0"),CountIf(.Range("Q7:Q12"), "<= 4")) but is does not like the first CountIf. Any help would be greatly appreciated Ta, Martin |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Tom,
Thanks for your help. It works great. Ta, Martin "Tom Ogilvy" wrote in message ... I am trying to 'combine' the above 2 functions like you can in excel I think you are remembering something that isn't true. =Sumproduct(--(L7:L12<0),--(Q7:Q12<=4)) in code A = Evaluate("Sumproduct(--(L7:L12<0),--(Q7:Q12<=4))") -- Regards, Tom Ogilvy "Martin Wheeler" wrote in message ... xl2003 I am trying to count the number of instances in range L7:Q12 in which the L cell is < 0 and the Q cell <= 4, as in A = Application.WorksheetFunction.CountIf(.Range("L7:L 12"), "< 0") B = Application.WorksheetFunction.CountIf(.Range("Q7:Q 12"), "< = 4") I am trying to 'combine' the above 2 functions like you can in excel, as in A = Application.WorksheetFunction.CountIf(CountIf(.Ran ge("L7:L12"), "< 0"),CountIf(.Range("Q7:Q12"), "<= 4")) but is does not like the first CountIf. Any help would be greatly appreciated Ta, Martin |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
countif | Excel Discussion (Misc queries) | |||
How do I use a countif function according to two other countif fu. | Excel Worksheet Functions | |||
edit this =COUNTIF(A1:F16,"*1-2*")+COUNTIF(A1:F16,"*2-1*") | Excel Discussion (Misc queries) | |||
COUNTIF or not to COUNTIF on a range in another sheet | Excel Worksheet Functions | |||
COUNTIF in one colum then COUNTIF in another...??? | Excel Worksheet Functions |