Two column XLOOKUP thing...I think...

Choppa1

New Member
Joined
Jan 8, 2025
Messages
1
Office Version
  1. 365
Platform
  1. Windows
Looking for a formula...

If either F2 "or" G2 contain a site...(as displayed) I need H2 to display the corresponding Region. As you can see I'm currently using XLOOKUP but I only know how to apply it to the one column. As you can see in the 9th row I'm getting the #N/A error...

bS00MzYzODc1LVYzalhuWA

The corresponding regions are on a separate tab...

bS00MzYzODc1LUV2MGp4ZA

Can anyone help me out on this one..?
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
Hi & welcome to MrExcel.
You can put another xlookup for G2 in the "if not found" argument of your existing formula.
 
Upvote 0
Let me know if something like this works
Formula applies to the highlighted cell.

=IF(AND(C4="",D4=""),"",IF(C4="",XLOOKUP(D4,$C$10:$C$13,$D$10:$D$13),XLOOKUP(C4,$C$10:$C$13,$D$10:$D$13)))
1736371104038.png


In your case I would do something like:
=if(AND(F2="",G2=""),"",if(F2="",xlookup(G2,Regions!B:B,Regions!C:C),xlookup(F2,Regions!B:B,Regions!C:C)))

please note that I have prioritized the site over the cam sites so you can see alpha and bravo are present but it chooses region 1 over 2 but in the second row its the reverse
 
Upvote 0
In your case using the not found position as suggested by Fluff, it would look something like this:
Excel Formula:
=XLOOKUP(F2,Regions!B:B,Regions!C:C,XLOOKUP(G2,Regions!B:B,Regions!C:C))
 
Upvote 0

Forum statistics

Threads
1,226,112
Messages
6,189,039
Members
453,521
Latest member
Chris_Hed

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top