tiredofit
Well-known Member
- Joined
- Apr 11, 2013
- Messages
- 1,926
- Office Version
- 365
- 2019
- Platform
- Windows
Is there a limit to the SUMPRODUCT?
This fails:
whereas this works:
The difference being the second one has fewer of these:
Thanks
This fails:
Code:
Dim LastRow as Integer
LastRow = 1000
Dim a As Variant
With Sheet1
a = Evaluate("=SUMPRODUCT((-1*('" & .Name & "'!AN2:AN" & LastRow & "+'" & .Name & "'!AR2:AR" & LastRow & ")/'" & .Name & "'!H2:H" & LastRow & "/12<=" & wksResults.Range("Monthly").Value & ")*('" & .Name & "'!H2:H" & LastRow & ">" & wksResults.Range("Monthly").Value & ") * ('" & .Name & "'!H2:H" & LastRow & "<=" & wksResults.Range("Monthly").Value & ") *( -1*('" & .Name & "'!AN2:AN" & LastRow & "+'" & .Name & "'!AR2:AR" & LastRow & ")/'" & .Name & "'!H2:H" & LastRow & "/12))")
End With
whereas this works:
Code:
Dim LastRow as Integer
LastRow = 1000
Dim a As Variant
With Sheet1
a = Evaluate("=SUMPRODUCT((-1*(AN2:AN" & LastRow & "+AR2:AR" & LastRow & ")/'" & .Name & "'!H2:H" & LastRow & "/12<=" & wksResults.Range("Monthly").Value & ")*('" & .Name & "'!H2:H" & LastRow & ">" & wksResults.Range("Monthly").Value & ") * ('" & .Name & "'!H2:H" & LastRow & "<=" & wksResults.Range("Monthly").Value & ") *( -1*('" & .Name & "'!AN2:AN" & LastRow & "+'" & .Name & "'!AR2:AR" & LastRow & ")/'" & .Name & "'!H2:H" & LastRow & "/12))")
End With
The difference being the second one has fewer of these:
Code:
'" & .Name & "'!
Thanks
Last edited: