Forum Discussion
Vlookup to multiple columns
Hello!
I was wondering if there was a formula to do a vlookup referencing 2 different columns? In the below example I have 2 tabs of data; on tab 1 I want to do a vlookup based off of column C however on Tab 2 the "month" can be found in either column G or H. Is there a formula that says vlookup column c and look to column G and H and return the result of I? Thank you!
5 Replies
- DPATELKOPCopper Contributor
AGAIN THANK FOR THIS THREAD
- SergeiBaklanDiamond Contributor
Slightly modified
=INDEX($J$4:$J$9, MATCH(1, INDEX( ($C4=$H$4:$H$9) + ($C4=$I$4:$I$9), 0), 0 ) )(no CSE)
- DPATELKOPCopper Contributor
Sp. THANKS FOR UOLOADING DEMO FILE. LOVED THIS SOLUTION. WORKED LIKE A CHARM FOR ME. BEAUTY IS I COULD CHANGE THE RANGE OF INPUT DATA AFTER COPY/PASTE IN ANY EXCEL FILE & WORK ON IT.
- OliverScheurichGold Contributor
=INDEX($I$4:$I$9,MATCH(1,MMULT(1*(C4=$G$4:$H$9),ROW($1:$2)^0),0))=VLOOKUP(C4,CHOOSE({1,2},$G$4:$G$9&$H$4:$H$9,$I$4:$I$9),2,0)An alternative could be INDEX / MATCH or VLOOKUP. Enter either formula with ctrl+shift+enter if you don't work with Office365 or 2021.
- flexyourdataIron Contributor
You can use INDEX/MATCH, like this:
=INDEX($I$4:$I$9,MATCH(C4,$G$4:$G$9&$H$4:$H$9,0),)Or XLOOKUP:
=XLOOKUP(C4,$G$4:$G$9&$H$4:$H$9,$I$4:$I$9)