
Originally Posted by
pjoaquin
My suggestion is that you post a more realistic example of your data. Also, VLOOKUP does not require that the lookup range be in alphabetical order, and it can certainly find text strings with letters and numbers (and characters, too).
Look in Excel Help for VLOOKUP, paying close attention to the 4th argument.
I stand corrected - my apologies. I suppose the bigger issue is that vlookup can only take a single argument, not an array like sumproduct.
Further to this, I have been attempting to increase the size of the array so that it matches the other using a function, however it's spitting out a #Value error.
Function filled_array(ref() As Variant, count As Integer) As Variant
Dim ref()
Dim count As Integer
Dim top As Integer
top = UBound(ref, 1)
ReDim ref(count)
ReDim Preserve ref(count)
For i = ref(top) To UBound(ref, 1)
ref(i) = 0
Next
filled_array = ref
End Function
As an example, I would use the following call from excel:
=sumproduct((filled_array(A1:A2,3))*(B1:B3))
This would increase the first array to the same size as the second and therfore would be able to sumproduct them. If I can get this bit working then I can use the same technique to my original question, that is, sumproduct with different ranges.
Bookmarks