Lookup challenge using Excel formulae

sharshra

Active Member
Joined
Mar 20, 2013
Messages
276
Office Version
  1. 365
I have to lookup values from a table. I tried different lookups, but they fetch the value of first occurrence only. In my case, it is a bit complicated & is not straight forward. Value that I'm looking for may not be at the first occurrence. Dummy table for illustration only is shown below. Can someone help to find a solution (without VBA) please?

Challenge 1 - I have to find out Name & Account holder from a reference table for each Account # from calling table. Account holder may not be there for all Names. Solution should read Account # in calling table, search all Account # in reference table & fetch the first occurrence of Account holder & corresponding Name.
Account #NameAccount holder
98765432testaccounttest
12345678abc456first holder


Challenge 2 - Similar to challenge 1. In this case, I need all values found for each Account #.
Account #NameAccount holder
98765432testaccounttest
12345678abc456, abcfirst holder, someone


Reference table -
NameAccount #Account holder
abc12312345678
abc45612345678first holder
abc12345678someone
xyz12345678
xyz78998765432
testaccount98765432test
mno76598765432
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
Like this?

sharshra.xlsm
ABCD
1
2Table1Account #NameAccount holder
398765432testaccounttest
412345678abc456first holder
5
6
7Table2Account #NameAccount holder
898765432testaccounttest
912345678abc456, abcfirst holder, someone
10
11
12Table3NameAccount #Account holder
13abc12312345678
14abc45612345678first holder
15abc12345678someone
16xyz12345678
17xyz78998765432
18testaccount98765432test
19mno76598765432
20
Sheet1
Cell Formulas
RangeFormula
C3:C4C3=INDEX(FILTER(Table3[Name],(Table3[Account '#]=[@[Account '#]])*(Table3[Account holder]<>""),""),1)
D3:D4D3=INDEX(FILTER(Table3[Account holder],(Table3[Account '#]=[@[Account '#]])*(Table3[Account holder]<>""),""),1)
C8:C9C8=TEXTJOIN(", ",1,FILTER(Table3[Name],(Table3[Account '#]=[@[Account '#]])*(Table3[Account holder]<>""),""))
D8:D9D8=TEXTJOIN(", ",1,FILTER(Table3[Account holder],(Table3[Account '#]=[@[Account '#]])*(Table3[Account holder]<>""),""))
 
Upvote 0
Solution
Thanks for that, Peter. When applied, it is throwing syntax error. I'm trying to understand how it works. For example, it should pick account # in table 2, search for name & account holder in table 3 & enter these values in table 2. But I don't see table 2 referred in the formula. Am I missing something?
 
Upvote 0
When applied, it is throwing syntax error.
How have you "applied" it?
You refer several times to what "it" should do. There are four formulas in my response. Which one of them is the "it" you are referring to?

I don't see table 2 referred in the formula.
My understanding is that the only formulas relating to Table2 are the ones in Table2. Since they are in Table2 they do not need to refer to their own table name?

Which, if any, of the results in my mini-sheets are incorrect?
 
Upvote 0
Table 2 will have account #. Other 2 columns (name & account holder) are to be derived from table 3, using account # to link between table 2 & 3.

Yes, I did apply these, but getting syntax error. Screenshot of error with formula in D8 is pasted below for reference.
1638878522680.png
 

Attachments

  • 1638878450149.png
    1638878450149.png
    6.6 KB · Views: 3
Upvote 0
In post #1 there is a column heading in each table "Account #"
In your image in post #5 the heading appears to be "account#"

The suggested formula was assuming the heading as in post #1
 
Upvote 0

Forum statistics

Threads
1,215,025
Messages
6,122,732
Members
449,093
Latest member
Mnur

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