Populating Field in Table1 Cell Based on Certain Table1 Cells matching Table2 Cells

jimdegeorge

New Member
Joined
May 13, 2010
Messages
7
Hi

I have two tables (Table1 and Table2) on 2 different tabs (Sheet1 and Sheet2, respectively).

Table1
NameCityLineDistrict
JamesBostonHard Goods
JohnLos AngelesSoft Goods
WilliamBaltimoreSoft Goods
HaroldMiamiHard Goods

<tbody>
</tbody>

Table2
NameCityDistrict
JamesBostonNorth East
JohnLos AngelesWest
WilliamBaltimoreCentral East
HaroldMiamiSouth East

<tbody>
</tbody>

When NAME and CITY from Table1 are found on Table2, I want to save Table2's DISTRICT value in the appropriate Table1 DISTRICT cell.


This is the desired Table1 result:
NameCityLineDistrict
JamesBostonHard GoodsNorth East
JohnLos AngelesSoft GoodsWest
WilliamBaltimoreSoft GoodsCentral
HaroldMiamiHard GoodsSouth East

<tbody>
</tbody>


I've tried these formulas in Table1 DISTRICT...

=IF(Table1[@[Name]:[City]]=Table2[@[Name]:[City]],Table2[@District],""), but this returns #VALUE !

=If(VLOOKUP(Table1[@[Name]:[City]],Table2[[Name]:[City]],C,FALSE),Table2[@District],""), but I can't get it formatted correctly.


I'd really appreciate any help!
Thanks!
Jim
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
Hi, Jim,

What about a concatenation of the Name & City fields and then use that for INDEX/MATCH or VLOOKUP?

Or an UPDATE query, using
Code:
UPDATE Table1 T1 INNER JOIN Table2 T2 ON T1.Name = T2.Name AND T1.City = T2.City
SET T1.District = T2.District

regards
 
Upvote 0

Forum statistics

Threads
1,215,222
Messages
6,123,704
Members
449,118
Latest member
MichealRed

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