Question: IN VBE iN EXCEL Write a function subroutine called AddProduct that mimics Excels SUMPRODUCT function. It should accept two arrays of type Single as input
IN VBE iN EXCEL
Write a function subroutine called AddProduct that mimics Excels SUMPRODUCT function.
It should accept two arrays of type Single as input arguments and it should return the sum of the products of the corresponding elements of the arrays.
For example, if you pass the arrays (3.5, 5, 1) and (4, 3, 6) to the function, it should return 3.5*4 + 5*3 + 1*6 = 35. You can assume that the arrays will have the same size.
Then write a short sub called Test that sets up two arrays, testArray1 and testArray2, passes them to the function, and reports the result. Use the following arrays to test your function, but your function should work with arrays of any size: testArray1 = (3.5, 5, 1) and testArray2 = (4, 3, 6).
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
