Please see attached excel file. The formula only works for one value - Q
and not for other values in column E
Thanks Carroll
Please see attached excel file. The formula only works for one value - Q
and not for other values in column E
Thanks Carroll
![]()
Sub zz() Dim d As Object, ar, br Set d = CreateObject("scripting.dictionary") ar = Range("e5:e" & [e1048576].End(3).Row) br = Range("i5:k" & [k1048576].End(3).Row) For i = 1 To UBound(br) For j = 1 To UBound(br, 2) - 1 d(br(i, j)) = br(i, UBound(br, 2)) Next Next For i = 1 To UBound(ar) ar(i, 1) = d(ar(i, 1)) Next [g5].Resize(UBound(ar)) = ar End Sub
UDF
Use in cell like
F5:
=LookUps(E5,$I$5:$K$9,3)
then fill down
To a Standard code module.
![]()
Function LookUps(myVal As Range, rng As Range, colRef As Long) With rng LookUps = Filter(.Parent.Evaluate("transpose(if((" & rng.Columns(1).Address & "=" & myVal.Address(, , , 1) & _ ")+(" & rng.Columns(2).Address & "=" & myVal.Address(, , , 1) & ")," & rng.Columns(3).Address & "))"), False, 0)(0) End With End Function
Does this array-entered** formula placed in cell F5 and copied down do what you want...
=IFERROR(INDEX(K:K,MAX(IF(E5=$I$5:$J$9,ROW(K$5:K$9),-1))),"")
**Commit this formula using CTRL+SHIFT+ENTER and not just Enter by itself
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks