I am trying to create a more user friendly version of the function sumproduct but I don't understand why the function is returning #VALUE!. Please advise:
Below is my code both array inputs are of the same length:
Function sp(x As Variant, y As Variant) As Double
psum = 0
For i = LBound(x) To UBound(x)
qsum = x(i) * y(i)
psum = psum + qsum
Next
sp = psum
End Function