View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
joeu2004 joeu2004 is offline
external usenet poster
 
Posts: 2,059
Default Sumproduct instead of SumifS in VBA (application.sumproduct)

On Dec 30, 4:08*am, Majken Bilslev-Jensen
wrote:
The following code does not work:

Application.SumProduct((Application.Index(holdings .Range("holdings"),
0, 1) = "ff") * (Application.Index(holdings.Range("holdings"), 0, 5) =
"gg") * Application.Index(holdings.Range("holdings"), 0, 3))


Try this:

Evaluate("SUMPRODUCT((INDEX(Holdings,0,1)="ff")*(I NDEX(Holdings,
0,5)="gg"),
INDEX(Holdings,0,3)")

Note: Enter the entire formula on __one__ VBA line or use apply VBA
line continuation syntax appropriately.