XLOOKUP - if 2 cells = certain criteria, then return 3rd value.

EddieD

New Member
Joined
Jun 12, 2014
Messages
30
Office Version
  1. 365
Platform
  1. MacOS
Hi all,
im struggling with this one a bit.

I have 2 tabs with almost the same data, except my Tab2 contains more complex calculations to get a result. That result (in column C) i want to place on TAB 1 (same column).

I would like to perform an X Lookup, that says - Lookup the SKU in Tab1, A1, and make sure that it matches B2 on the same row, then produce the result from column C.



TAB 1

SKULocationJanuary Sales QTY
Car-123USAReturn figure from Tab 2
Car-123CanadaReturn figure from Tab 2
Car-456USAReturn figure from Tab 2
Car-456CanadaReturn figure from Tab 2


TAB 2

SKULocationJan Sales QTY
Car-123USA125
Car-123Canada667
Car-456USA441
Car-456Canada335
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
Hi @EddieD . Thanks for posting on the forum.

Try this:

Dante Amor
ABC
1SKULocationJanuary Sales QTY
2Car-123USA125
3Car-123Canada667
4Car-456USA441
5Car-456Canada335
TAB 1
Cell Formulas
RangeFormula
C2:C5C2=SUMPRODUCT(('TAB 2'!$A$2:$A$5=A2)*('TAB 2'!$B$2:$B$5=B2)*('TAB 2'!$C$2:$C$5))


--------------
Let me know the result and I'll get back to you as soon as I can.
Cordially
Dante Amor
--------------​
 
Upvote 0
in Cell C2 of Tab1 try:

Excel Formula:
= XLOOKUP(A2&B2,Tab2!A2:A50&Tab2!B2:B50,Tab2!C2:C50)

proof of concept:
Book1
ABCDEFGH
1SKULocationJan Sales QTY
2Car-123USA125Car-123Canada667
3Car-123Canada667
4Car-456USA441
5Car-456Canada335
Sheet1
Cell Formulas
RangeFormula
H2H2=XLOOKUP(F2&G2,A2:A5&B2:B5,C2:C5)
 
Upvote 0
Solution
Another option
Excel Formula:
=SUMIFS(Sheet1!C:C,Sheet1!A:A,A2,Sheet1!B:B,B2)
 
Upvote 0
Thank you.
This was similar to my first try - but i keep showing a #VALUE! error. Even though there is data there.
 
Upvote 0
Thank you.
This was similar to my first try - but i keep showing a #VALUE! error. Even though there is data there.
Are you trying to get a sum of matches? I did not read your question that way. But, if so... you probably have some values that excel thinks are text. Format column C as general or number, and then do a text to column on column C to be sure you convert everything the numeric values.
 
Upvote 0
Which formulae are you referring to?
 
Upvote 0

Forum statistics

Threads
1,223,894
Messages
6,175,254
Members
452,624
Latest member
gregg777

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