WorkSheetFunction.CountIf & WorkSheetFunction.SumIf with 2 conditions?

E

Etien

Hi there,

Is there a way to get WorksheetFunction.CountIf and .SumIf to work wit
2 conditions?

I know how to use

SUMPRODUCT((xRg/aCondition)*(yRg/bCondition))

and

SUMPRODUCT((xRg/aCondition)*(yRg/bCondition)*(zRg to count))

in Excel, but could not find a way to translate this into VBA code...


Thanks a lo
 
B

Bob Phillips

Etien,

SUMPRODUCT won't work as a worksheetfunction, you need to evaluate the
formula

Evaluate("=SumProduct((A1:A3 =""X"")*(B1:B3=""Y""))")


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
E

Etien

Works great!

It was a bit tough to include my range variables (!) in there, but i
works now.

Thanks a lo
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top