View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jim Thomlinson Jim Thomlinson is offline
external usenet poster
 
Posts: 5,939
Default VBA €“ Problem with compound SUMIF function

You probably want to use a sumpriduct formula... Take a look at this website...

http://www.xldynamic.com/source/xld.SUMPRODUCT.html
--
HTH...

Jim Thomlinson


"gary" wrote:

I am trying to select criteria from two columns and then do a sum on two
other columns. The first SUMIF works fine (with any single criteria) but I
am unable to add the second criteria. When I try, I get a €œtype mismatch€
error.

This works:
Total = SUMIF (Application.SUMIF (Range (€œL4:L500)", ItemEmp, Range
("M4:N500€))

This does not work:

Total = SUMIF (Application.SUMIF ( (Range (€œL4:L500") =ItemEmp) * (Range
(€œD4:D500") =ItemColor), Range ("M4:N500€))

Thanks,

gary