View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips Bob Phillips is offline
external usenet poster
 
Posts: 10,593
Default SumIf with 2 ctiteria

myVal =
ActiveSheet.Evaluate("=SUMPRODUCT(--(D1:D1000=""value_1""),--(E1:E1000=""val
ue_2""),K1:K1000)")


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Jimbo" wrote in message
...
Thanks Bob,
I don't follow the syntax of the code you supplied ... where doe I specify
the values to be summated i.e. Column K
can you enlighten me or point me to a url for an explanation of the syntax
Regards
Jim Burton

"Bob Phillips" wrote in message
...
myVal =

ActiveSheet.Evaluate("=SUMPRODUCT(--(D1:D1000=""value_1""),--(E1:E1000=""val
ue_2""))")


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Jimbo" wrote in message
...
I need to sum the values in Column K if the values in Column D AND

Column
E
meet different criteria

e.g. Sum of values in Col K .... only if corresponding values Col D =
value_1 and Col E = value_2

Please post relevant vbacode

Thanks & TIA