XLOOKUP across multiple columns and return specific value if found

karweng

New Member
Joined
Aug 24, 2021
Messages
12
Office Version
  1. 365
Platform
  1. Windows
CASHCREDIT CARDMIXLookupReturn Value
AYNNACASH
BNYNBCREDIT CARD
CNNYCMIX
DNYNDCREDIT CARD

Hi, Does anyone know the formula that I can use to lookup value A across 3 columns (CASH, CREDIT CARD, MIX). if either of the columns have a Y value, return the value as the column header.

Currently the formula I am using is =IF(XLOOKUP(F2,$A$2:$A$5,$B$2:$B$5)="Y","CASH",IF(XLOOKUP(F2,$A$2:$A$5,$C$2:$C$5)="Y","CREDIT CARD",IF(XLOOKUP(F2,$A$2:$A$5,$D$2:$D$5)="Y","MIX"))), is there a cleaner way of writing this formula?
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
Like this?

21 11 27.xlsm
ABCDEFG
1CASHCREDIT CARDMIXLookupReturn Value
2AYNNACASH
3BNYNBCREDIT CARD
4CNNYCMIX
5DNNND 
Lookup
Cell Formulas
RangeFormula
G2:G5G2=XLOOKUP("Y",INDEX(B$2:D$5,MATCH(F2,A$2:A$5,0),0),B$1:D$1,"")
 
Upvote 0

Forum statistics

Threads
1,215,417
Messages
6,124,789
Members
449,188
Latest member
Hoffk036

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