A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data
Good day,
Based on the example provided, you need to perform a lookup using two matching criteria. Excel must compare:
- Tab 1, Column C with Tab 2, Column A
- Tab 1, Column D with Tab 2, Column B
When both values match on the same row, Excel can return the corresponding value from Tab 2, Column C into Tab 1, Column M.
Assuming your worksheets are named Tab 1 and Tab 2, you can enter the following formula in M2 on Tab 1:
=XLOOKUP(1,('Tab 2'!$A$2:$A$1000=C2)*('Tab 2'!$B$2:$B$1000=D2),'Tab 2'!$C$2:$C$1000,"Not found")
Then copy the formula down through the rest of Column M.
This approach works because each comparison returns a TRUE/FALSE result, and only rows where both conditions are met evaluate to 1. XLOOKUP then returns the corresponding value from Column C on Tab 2.
For your sample data, the expected results would be:
-
84459939+SIP Trunks (See SIP Service)> Voiceflex -
01604621731+Analogue Line> Gamma
Note: I noticed that one of the IDs contains a leading zero (01604621731) in Tab 2, while the corresponding value in Tab 1 appears as 1604621731. If one value is stored as text and the other as a number, Excel may not recognize them as a match.
In that case, you can use the following formula, which converts numeric-looking values before comparing them and helps account for leading zeros:
=XLOOKUP(1,(IFERROR(--'Tab 2'!$A$2:$A$1000,'Tab 2'!$A$2:$A$1000)=IFERROR(--C2,C2))*('Tab 2'!$B$2:$B$1000=D2),'Tab 2'!$C$2:$C$1000,"Not found")
As an additional tip, avoid using entire-column references (such as A:A) in multi-condition lookup formulas, as this can affect performance. Also, ensure that all referenced ranges are the same size and start/end on the same rows. If your regional settings use semicolons (;) instead of commas (,), replace the separators accordingly.
I hope this points you in the right direction. If you continue to experience issues, please let me know the exact error message or the version of Excel you're using, and I'll be happy to assist further.
Thank you for your understanding, and wishing you a wonderful day ahead.
If the answer is helpful, please click "Yes". If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in the forum documentation to enable e-mail notifications if you want to receive the related email notification for this thread.