Map and append data in rows based on another sheets rows

sunnykeerthi

New Member
Joined
Dec 6, 2021
Messages
2
Office Version
  1. 365
Platform
  1. MacOS
Hi,

I've 2 Excel sheets as below. In my first sheet, I've First name, Last name and City.
In the 2nd, I got Address 1, City, State, Zip code and Country.

Here I want to match the City in sheet 2 with the city in sheet 1(it should be a contains, not equals to) and paste the entire row from sheet 2 in sheet 1 next to the city.

Names and Cities.xlsx
ABC
1First NameLast NameCity
2JohnWickNew york
3GeorgePhillipCincinati
4KarenD'souzaCleveland
5RaviMalhotraSaint Paul
6RyanMillerHouston
Sheet1


Names and Cities.xlsx
ABCDE
1Addr1CityStateZipCountry
22885 Morningview LaneNew YorkNY10013US
3757 Grey Fox Farm RoadHoustonTX77002US
4999 Corbin Branch RoadClevelandTN37311US
5321 Rogers StreetCincinatiOH45236US
63097 Hayhurst LaneSaint PaulMN55121US
Sheet2


The output should be like this.

Names and Cities.xlsx
ABCDEFGH
1First NameLast NameCity
2JohnWickNew york2885 Morningview LaneNew YorkNY10013US
3GeorgePhillipCincinati321 Rogers StreetCincinatiOH45236US
4KarenD'souzaCleveland999 Corbin Branch RoadClevelandTN37311US
5RaviMalhotraSaint Paul3097 Hayhurst LaneSaint PaulMN55121US
6RyanMillerHouston757 Grey Fox Farm RoadHoustonTX77002US
Sheet1


Sorry for asking the solution directly. I'm very new to Excel (I know this sounds very odd ?).
I tried VLOOKUP, but it gives only True/False, so as the MATCH does.

Thanks
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
Ok, FIRST - if you don't have office 365 or the newest one you need to move the cities column in the second sheet to in front of the address column. If you do have office 365 or the newest version you can use xlookup instead of vlookup and don't have to move anything.

Second - in the columns in sheet one where you want the information to go (EFGH in your example) you are going to put the following formulas;
basically: =Vlookup(sheet1citynamecell,'sheet2citynamecell'!XX,Columnindex (in your example the cell indexes would be 2,3,4, and 5 for city, state zip and country),FALSE (for exact match)
Ex:
E:=Vlookup(C2,'SHEET2NAME'!A2,2,FALSE) / (not entirely sure how to use Xlookup as I haven't used it before)
F:=Vlookup(C2,'SHEET2NAME'!A2,3,FALSE) /
G:=Vlookup(C2,'SHEET2NAME'!A2,4,FALSE) /
H:=Vlookup(C2,'SHEET2NAME'!A2,5,FALSE) /

Then -
Copy thosecells and paste down to have the formula autofill for each row
 
Upvote 0
you are getting an error because the vlookup value has to be in the front of the table for it to work.
 
Upvote 0
Hi & welcome to MrExcel.
What version of Excel are you using?

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)
 
Upvote 0
Upvote 0

Forum statistics

Threads
1,224,822
Messages
6,181,165
Members
453,021
Latest member
Justyna P

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