Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Public Function INDEXMATCH(LookupValue, LookupColumn As Range, ReturnColumn As Range)
- On Error GoTo ErrorHandler
- INDEXMATCH = WorksheetFunction.Index(ReturnColumn, WorksheetFunction.Match(LookupValue, LookupColumn, 0))
- Done:
- Exit Function
- ErrorHandler:
- If Err.Number = 1004 Then
- INDEXMATCH = "N/A"
- End If
- End Function
- Public Function INDEXMATCHMATCH(VertLookupValue, HorizLookupValue, LookupMatrix As Range)
- On Error GoTo ErrorHandler
- LeftColumn = LookupMatrix.Columns(1)
- TopRow = LookupMatrix.Rows(1)
- INDEXMATCHMATCH = WorksheetFunction.Index(LookupMatrix, WorksheetFunction.Match(VertLookupValue, LeftColumn, 0), WorksheetFunction.Match(HorizLookupValue, TopRow, 0))
- Done:
- Exit Function
- ErrorHandler:
- If Err.Number = 1004 Then
- INDEXMATCHMATCH = "N/A"
- End If
- End Function
Advertisement
Add Comment
Please, Sign In to add comment