Reputation: 253
I have the following columns in excel, i want to change the ID column to New ID based on Match ID, for example on the ID column first data is Zrecruit_376840000000415007 which is Zrecruit_376840000000415007 = 5789 in Match ID and New ID column the ID should be replaced to 5789.
ID Match ID New ID
Zrecruit_376840000000415007 Zrecruit_376840000000367020 = 5782
Zrecruit_376840000000215296 Zrecruit_376840000000375036 = 5783
Zrecruit_376840000000217195 Zrecruit_376840000000389001 = 5784
Zrecruit_376840000000218111 Zrecruit_376840000000369168 = 5785
Zrecruit_376840000000219665 Zrecruit_376840000000392001 = 5786
Zrecruit_376840000000222030 Zrecruit_376840000000410013 = 5787
Zrecruit_376840000000226008 Zrecruit_376840000000432013 = 5788
Zrecruit_376840000000227079 Zrecruit_376840000000415007 = 5789
Upvotes: 0
Views: 2960
Reputation: 781
Try this
=REPLACE(VLOOKUP(A2 & "*",$B$2:$B$9,1,0),1,FIND("=",VLOOKUP(A2 & "*",$B$2:$B$9,1,0),1)+3,"")
Here “+3” denotes Three spaces after “=” Char. Change this as per your requirement
ID = Column A
Matched ID = Column B
New ID = Column C
Paste this formula in column C
Upvotes: 1
Reputation: 1713
You can write a formulae to find the row number for the match and get its corresponding cell value, something similar to below
=INDIRECT(ADDRESS(MATCH(A2,B2:B9,0),3))
This formulae :
This will give you the values in the newer column then you can copy paste it where you want,
Or you can write similar function in the VBA script to replace the value directly
Upvotes: 0