Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
vba for countif
I have a table of data in range A1:F10. In cell H1 I have the following
array formula: =SUM((A2:A10=J1)*(B2:B10=K1)*(C2:C10=L1)*(D2:F10=M 1)) I don't want VBA that will put this formula into H1; rather, I want a VBA that will make the Value of H1 equal to the result of a like VBA formula. -- Thanks Shawn |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
vba for countif
I seem to have figured it out:
Worksheets("Sheet1").Range("h2").Value = Evaluate("=SUMPRODUCT((A1:A10 = J1)*(B1:B10=k1)*(C1:C10=L1)*(D1:F10=m1))") -- Thanks Shawn "Shawn" wrote: I have a table of data in range A1:F10. In cell H1 I have the following array formula: =SUM((A2:A10=J1)*(B2:B10=K1)*(C2:C10=L1)*(D2:F10=M 1)) I don't want VBA that will put this formula into H1; rather, I want a VBA that will make the Value of H1 equal to the result of a like VBA formula. -- Thanks Shawn |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
vba for countif
dont use global(application) evaluate if you want your code to work consistently (and independant of activesheet) instead use worksheets("sheet1").evaluate -- keepITcool | www.XLsupport.com | keepITcool chello nl | amsterdam Shawn wrote : I seem to have figured it out: Worksheets("Sheet1").Range("h2").Value = Evaluate("=SUMPRODUCT((A1:A10 = J1)*(B1:B10=k1)*(C1:C10=L1)*(D1:F10=m1))") |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
vba for countif
Why did you switch to SUMPROUCT, SUM worked as well?
-- HTH Bob Phillips "Shawn" wrote in message ... I seem to have figured it out: Worksheets("Sheet1").Range("h2").Value = Evaluate("=SUMPRODUCT((A1:A10 = J1)*(B1:B10=k1)*(C1:C10=L1)*(D1:F10=m1))") -- Thanks Shawn "Shawn" wrote: I have a table of data in range A1:F10. In cell H1 I have the following array formula: =SUM((A2:A10=J1)*(B2:B10=K1)*(C2:C10=L1)*(D2:F10=M 1)) I don't want VBA that will put this formula into H1; rather, I want a VBA that will make the Value of H1 equal to the result of a like VBA formula. -- Thanks Shawn |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
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 |