Retrieve text from col C if text matches in Col A & B

Jubinell

Board Regular
Joined
Jan 17, 2008
Messages
166
Hi,

Let's say I have a master table with company name, person name's and business title. Now have a subtable with names of a few companies and names of a few people belonging to those companies. I'd like to query from the master table the appropriate business title of those people in those companies.

Could you tell me the easiest way to do this?
I've looked around and explored a little bit with If array formulas, pivot tables, and MS queries. The problem I have is that the thing I want to pull is text, not number, and also there is a chance of duplication! (person A in company B may have multiple business titles in master table). I'd like to some how pull the correct text while keeping tag of whether the pulled data is unique or not.

Any advice would be greatly appreciated!

Edit: Creating a pivot table then deselecting the unwanted companies and people is not feasible since the master table contains more than 10,000 entries.
 
Last edited:

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
With your data set up like so,,
Excel Workbook
ABCDEFGH
1My Criteria RangeOutPut
2Co NamePersonnel NameTitle
3ABC CompanyJim May<< Enter Both Cells Here !!Owner, VP-Ops<< OutPut Here !!
4
5Co NamePersonnel NameTitle
6ABC CompanyJim MayOwner, VP-Ops
7XYZ CoJoe DoeManager
8Ford CorpTom FordPresident
Sheet1
Excel 2007

You could paste into a Standard Module this code:

And your output would show up in Cell F3 I'd put a Forms Command Button on the
form to run the macro AFTER you enter new data in Cells A3 and B3

Just a thought...

Code:
Sub GetTitle()
    ActiveSheet.Range("A5:C8").AdvancedFilter Action:=xlFilterCopy, _
        CriteriaRange:=Range("A2:B3"), CopyToRange:= _
        Range("F2"), Unique:=False
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,848
Messages
6,121,914
Members
449,054
Latest member
luca142

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