Two sheets, Street, City copy ID

Beginner778

New Member
Joined
Sep 23, 2021
Messages
6
Hi,

I have two sheets:

Sheet 1 (1K rows)

Street (A column)
City (B column)

Sheet 2 (2K rows)
Street (A column)
City (B column)
ID (C column)

Problem: If the street and city match in the sheets (1,2), copy the ID to the C column in Sheet 1

I tried modifying the code with bold text

Thank you very much for help
 
But column C on Sheet1 is calculated so will be empty unless columns A and B match.
 
Upvote 0

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Sorry Zip its not good but phone so:

Sheet2:
1633349716303.png

Sheet1:
1633349732800.png


Function to D column if phone number Sheet1 row E=Sheet2 rowD copy ID to column D
 
Upvote 0
Beginner778-2.xlsx
ABCD
1StreetCityIdTelephone No
2MainMiamiABC1
31stMiamiMNB2
4ElmBriceXYZ
5OakBelmontPGT4
6AABBAWS123
Sheet2


Beginner778-2.xlsx
ABCDE
1StreetCityId by City, StreetId by PhonePhone no
2ElmMiami  
3ElmBriceXYZ 3
4MainMiamiABCABC1
51stNew York  
6OakPortland  
7OakBelmontPGTPGT4
8CCDD AWS123
Sheet1
Cell Formulas
RangeFormula
C2:C8C2=IF(A2="","",IFERROR(INDEX(Sheet2!$C$2:$C$1200,AGGREGATE(15,6,ROW(Sheet2!$A$2:$A$1200)-ROW(Sheet2!$A$1)/((Sheet2!$A$2:$A$1200=A2)*(Sheet2!$B$2:$B$1200=B2)),1)),""))
D2:D8D2=IF(ISNA(MATCH(E2,Sheet2!$D$2:$D$1200,0)),"",INDEX(Sheet2!$C$2:$C$1200,MATCH(E2,Sheet2!$D$2:$D$1200,0)))
 
Upvote 0

Forum statistics

Threads
1,214,790
Messages
6,121,608
Members
449,038
Latest member
apwr

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