ergo said:
....
would
{=sum(if((A1:A20=1000)*(B1:B20=2000));C1:C20;0)} (matrix formula!)
Actually, this is a syntax error even with ; as list separator. Maybe
=SUM(IF((A1:A20=1000)*(B1:B20=2000)),C1:C20,0))
do the same? And why does it give other results as
{=sum(if(and((A1:A20=1000);(B1:B20=2000)));C1:C20;0)}
And this is a worse syntax error. Maybe
=SUM(IF(AND((A1:A20=1000),(B1:B20=2000)),C1:C20,0))
Both syntactically invalid with typical English language regional settings
in which comma , is the list separator character. If you're going to post
in English language newsgroups, note this fact.
Mike H's formula and your first formula would give the same results except
when C1:C20 contained any boolean values or nonnumeric text. In that case,
Mike H's formula would produce different numeric results (treating Boolean
TRUEs as if they were 1s) or #VALUE! (caused by nonnumeric text). Your first
formula would skip such values in C1:C20.
Your second formula doesn't do the same thing because AND returns ONE AND
ONLY ONE value as its result. That means
AND((A1:A20=1000),(B1:B20=2000))
is evaluated as
AND(A1=1000,A2=1000,...,A20=1000,B1=2000,B2=2000,...,B20=2000)
but (A1:A20=1000)*(B1:B20=2000) returns and array of 1s or 0s depending on
whether the column A and B cells IN EACH ROW SEPARATELY satisfy their
respective criteria. Your second formula would be faster because the first
argument to IF would return FALSE more quickly, so the outer SUM call would
return 0 more quickly. Your formula would only return something other than
zero when EVERY entry in A1:A20 were 1000 AND EVERY entry in B1:B20 were
2000.