![]() |
Match and sort
Hi,
I have some data like this in excel sheet in two columns A and B. I want to match the items in Column B with column A and if it finds any match has to place that item in the same column but in the row where it was matched. A B In the diamond In the diamond In the diamond Trench Safety In the diamond The City The City The City The City Trench Safety Result should be like this: In the diamond In the diamond In the diamond In the diamond The City The City The City The City Trench Safety Trench Safety It should place in the first cell only though it has multiple matching cells in the left column as shown above. Can i do this with some match or sort ..How can i do this |
Match and sort
Code: -------------------- A B C In the diamond =IF(ROW()=MATCH(A1,A:A,FALSE),VLOOKUP(A1,$C$1:$C$3 ,1,FALSE),"") In the diamond In the diamond =IF(ROW()=MATCH(A2,A:A,FALSE),VLOOKUP(A2,$C$1:$C$3 ,1,FALSE),"") Trench Safety In the diamond =IF(ROW()=MATCH(A3,A:A,FALSE),VLOOKUP(A3,$C$1:$C$3 ,1,FALSE),"") The City The City =IF(ROW()=MATCH(A4,A:A,FALSE),VLOOKUP(A4,$C$1:$C$3 ,1,FALSE),"") The City =IF(ROW()=MATCH(A5,A:A,FALSE),VLOOKUP(A5,$C$1:$C$3 ,1,FALSE),"") The City =IF(ROW()=MATCH(A6,A:A,FALSE),VLOOKUP(A6,$C$1:$C$3 ,1,FALSE),"") Trench Safety =IF(ROW()=MATCH(A7,A:A,FALSE),VLOOKUP(A7,$C$1:$C$3 ,1,FALSE),"") -------------------- The Row()=MATCH() code just tells it to put in a blank if this isn't the first occurance of the tex in column A. I used vlookup to return the values in column C if it mached the item in column A. This code takes your exact input and produces your exact output...but I don't know if it will do you what you want in reality :). -- Lotus123 ------------------------------------------------------------------------ Lotus123's Profile: http://www.excelforum.com/member.php...o&userid=28611 View this thread: http://www.excelforum.com/showthread...hreadid=486009 |
All times are GMT +1. The time now is 04:55 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com