#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
vijaya
 
Posts: n/a
Default 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

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Lotus123
 
Posts: n/a
Default 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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to match and sort lakegoddess Excel Discussion (Misc queries) 0 November 14th 05 05:14 PM
How do I match identical values in 2 columns and then sort? Godswatch Excel Discussion (Misc queries) 1 November 9th 05 06:55 PM
How to match sort and lineup 2 sets of data VTALABRAT Excel Worksheet Functions 0 June 23rd 05 12:26 AM
Sum if or some sort of match formula JavyD Excel Worksheet Functions 3 May 5th 05 05:14 PM
A sort of lookup or match lehigh46 Excel Worksheet Functions 1 February 26th 05 02:47 AM


All times are GMT +1. The time now is 10:55 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"