I'm trying to write a custom function that will let me retrieve a cell from the first row in a range that meets x number of criteria. I imagine this would be very similar to the way SUMIFS works, just simpler in that it doesn't continue processing after the first match.
Does anyone know code to reproduce the SUMIFS (excel 07) function in VBA?
So, for example, if I have a table in excel like:
W X Y Z
a b 6 1
a b 7 2
b b 7 3
I want to be able to write a function that will give me the value in column Z where columns W=a, X=b, Y>=7 (in other words the value 2).
SUMIFS can approximately do this, assuming the record I want is unique and I'm looking to return a number. For my purposes though, those assumptions won't work.