Help with XLOOKUP

zinah

Active Member
Joined
Nov 28, 2018
Messages
355
Office Version
  1. 365
Platform
  1. Windows
Hi,

I have a below table that EEIDs and some of those EEID have multiple categories, what I need to do is to get only the EEID with Promotion category. The formula I have brings the first category of each EEID only, how can I edit the formula to let it bring only the Promotion category and if it's not Promotion then "Not Promotion"

Thanks!

XLOOKUP Help.xlsx
ABCDEFGHI
1EEIDCategoryEEIDPromotion Status
2AAATransferAAATransfer
3BBBData ChangeBBBData Change
4CCCPromotionCCCPromotion
5DDDCompensation Change OnlyDDDCompensation Change Only
6AAACompensation Change OnlyEEEPromotion
7CCCTransferRRRPromotion
8DDDData Change
9EEEPromotion
10CCCCompensation Change Only
11AAATransfer
12DDDData Change
13BBBPromotion
14EEECompensation Change Only
15AAAPromotion
16RRRPromotion
17
18
19
Sheet1
Cell Formulas
RangeFormula
I2:I7I2=XLOOKUP(H2,$A$2:$A$16,$B$2:$B$16)
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
Give this a shot
Excel Formula:
=XLOOKUP(1,(A2:A16=H2)*(B2:B16="Promotion"),B2:B16,"")
Thank you for your quick response! Do I need to edit the formula to be like this instead?
Excel Formula:
=XLOOKUP(1,($A$2:$A$16=H2)*($B$2:$B$16="Promotion"),$B$2:$B$16,"")
 
Upvote 0
Do I understand you correctly: Using the top cells H2:I2 as an example, you want a formula which looks for a row with 'AAA' in column A and 'Promotion' in column B, then returns Promotion/No Promotion in I2 respectively?

It sounds like you'd want to use =IF(COUNTIFS):

=IF(COUNTIFS($A$2:$A$16,$H2,$B$2:$B$16,"Promotion"),"Promotion","No Promotion")

ie. If both desired values are found in both columns, then the countifs return True and the IF returns 'Promotion'; if not, it returns False and the IF returns 'No Promotion'.
 
Upvote 1
Do I understand you correctly: Using the top cells H2:I2 as an example, you want a formula which looks for a row with 'AAA' in column A and 'Promotion' in column B, then returns Promotion/No Promotion in I2 respectively?

It sounds like you'd want to use =IF(COUNTIFS):

=IF(COUNTIFS($A$2:$A$16,$H2,$B$2:$B$16,"Promotion"),"Promotion","No Promotion")

ie. If both desired values are found in both columns, then the countifs return True and the IF returns 'Promotion'; if not, it returns False and the IF returns 'No Promotion'.
Yes, you did understand me correctly and your formula worked too, thank you so much for your help :)
 
Upvote 0

Forum statistics

Threads
1,215,461
Messages
6,124,957
Members
449,200
Latest member
indiansth

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