Vlookup - Two lookupvalues - complex

cpsnuggle

New Member
Joined
Jul 29, 2021
Messages
30
Office Version
  1. 365
Platform
  1. Windows
Hi,

I have below table of which I need to apply the Vlookup function to get my input right.

I have my Table_Array which contains Code, Name, Number & Currency. I need my function to be able to distinguish between numbers. E.g. If I type 100 in lookup value it would just return the first line which matches 100. But as seen in the table_array, there are different numbers for the same code. So what I essentially need is the function to call the written number, when I manually type in the code (Lookupvalue_1) and the currency (lookupvalue_2)

Thanks in advance


1628576785432.png
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
Supposing your table starts in col F try
Excel Formula:
=sumproduct(--(F3:F9=A3),--(I3:I9=D3)*H3:H9)
for number
For name
Excel Formula:
=INDEX(F3:I9,sumproduct(--(f3:f9=a3),--(h3:h9=d3),row(f3:i9))-row(f3:i9+1)
 
Upvote 0
Supposing your table starts in col F try
Excel Formula:
=sumproduct(--(F3:F9=A3),--(I3:I9=D3)*H3:H9)
for number
For name
Excel Formula:
=INDEX(F3:I9,sumproduct(--(f3:f9=a3),--(h3:h9=d3),row(f3:i9))-row(f3:i9+1)
Does this look rights?
Excel Formula:
=INDEX(G36:J42;sumproduct((G36:G42=A3);(J36:J42=E36);row(G36:J42))-row(G36:J42+1))

Based on this table:
1628581207569.png
 
Upvote 0
Like this?
Excel Formula:
=INDEX($G$36:$J$42;sumproduct(($G$36:$G$42=$B$36);($J$36:$J4$2=$E$36);row(G36:J42))-row(G36:J42)+1)

Use commas or semi colons according to your regional settings
 
Upvote 0
Like this?
Excel Formula:
=INDEX($G$36:$J$42;sumproduct(($G$36:$G$42=$B$36);($J$36:$J4$2=$E$36);row(G36:J42))-row(G36:J42)+1)

Use commas or semi colons according to your regional settings
It doesn't seem to work, when I write "100" as code and "USD" as currency
1628589352375.png
 
Upvote 0
Typo sorry
=INDEX($G$36:$J$42;sumproduct(($G$36:$G$42=$B$36);($J$36:$J$42=$E$36);row(G36:J42))-row(G36:J42)+1)
 
Upvote 0
Your profile says you have 365 which gives you quite a number of additional options.

Xlookup

20210810 XLookup Filter Lookup.xlsx
ABCDEF
2Lookupvalue_1NameNumberLookupvalue_2
3100A10363USD
490B10680USD
5130C10116USD
6
XLookup
Cell Formulas
RangeFormula
C3:D5C3=XLOOKUP(1,($G$3:$G$9=$B3)*($J$3:$J$9=$E3),H$3:H$9)


Filter

20210810 XLookup Filter Lookup.xlsx
ABCDEF
2Lookupvalue_1NameNumberLookupvalue_2
3100A10363USD
490B10680USD
5130C10116USD
6
Filter
Cell Formulas
RangeFormula
C3:D5C3=FILTER($H$3:$I$9,($G$3:$G$9=$B3)*($J$3:$J$9=$E3),"Not Found")
Dynamic array formulas.
 
Upvote 0
When applying both of the above, I get #N/A (Xlookup) and "Not Found" (Filter). Any suggestions?
 
Upvote 0
Try this:
  • Click on the copy symbol on the XL2BB below
  • Click on B34 of your spreadsheet (assuming the picture you gave of the row / column position in Post #3 & #5 is accurate)
  • And Paste
20210810 XLookup Filter Lookup.xlsx
BCDEF
34Input
35Lookupvalue_1NameNumberLookupvalue_2
36100A10363USD
3790B10680USD
38130C10116USD
39
XLookup
Cell Formulas
RangeFormula
C36:D38C36=XLOOKUP(1,($G$36:$G$42=$B36)*($J$36:$J$42=$E36),H$36:H$42)
 
Upvote 0
Solution

Forum statistics

Threads
1,215,429
Messages
6,124,840
Members
449,193
Latest member
MikeVol

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