Best way to search/replace data in large dataset

Brutusar

Board Regular
Joined
Nov 23, 2019
Messages
98
Office Version
  1. 365
Platform
  1. Windows
Hi, I have excel sheets that have a city name and a country in two colums. I need to do a search and replace in order to get the UNLOAD codes in the third column. For example. New York, USA has the port load code USNYC. So, Col A = New York. Col B = USA After a search and replace Col C should = USNYC.

This is probably best done in two operations. First finding the country code as there is only 250 of them so it should not take too much. However, the full port code list is over 100 000 rows. So if the countries are found first it can be used to limit the total numbers of port codes to look thru by filtering on the countries needed.

Does anyone have any thoughts on how to do this best?
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
64,133
Office Version
  1. 365
Platform
  1. Windows
Which columns are the country, City & code in on the list?
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
64,133
Office Version
  1. 365
Platform
  1. Windows
Ok how about
Excel Formula:
=FILTER(Sheet1!$C$2:$C$100000,(Sheet1!$A$2:$A$100000=A2)*(Sheet1!$B$2:$B$100000=B2))
Change sheet1 to the name of the sheet with the codes.
 

Brutusar

Board Regular
Joined
Nov 23, 2019
Messages
98
Office Version
  1. 365
Platform
  1. Windows

ADVERTISEMENT

Not sure if I have explained well enough (I am terrible at explaining) I need to find the portcode for maybe 300 ports at the time, and then save the result.. Will your suggestion do that? (Apart from the saving of course)
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
64,133
Office Version
  1. 365
Platform
  1. Windows
Yes you can just drag that formula down however many rows of data you need.
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
64,133
Office Version
  1. 365
Platform
  1. Windows
You're welcome
 
Solution

Forum statistics

Threads
1,144,687
Messages
5,725,769
Members
422,639
Latest member
i have a question

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
Top