I'm trying to calculate a cross currency rate by simply summing the forex rates for A/B and B/C and multiplying the means to find the A/C rate and I keep getting 0 in return. This is the code:
Function forex(audData As Range, euData As Range)
a = Application.Count(audData)
e = Application.Count(euData)
'Counts how many values are in the data
aSum = 0
eSum = 0
aMean = 0
eMean = 0
For i = 1 To aud ' This sums the 1st forex rate and finds the mean
aSum = aSum + audData(i)
Next i
aMean = aSum / a
For i = 1 To eu ' This sums the 2nd forex rate and finds the mean
eSum = eSum + euData(i)
Next i
eMean = eSum / e
forex = (aMean * eMean)
End Function