Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,388
Default How to sort data according two matching cells?

Hi,

I have this problem with sorting my data. I have data that is in two lists
like

col a---col b col d---col e
001 a 002 k
020 f 041 l
041 i 554 p

How can I sort all this data so that both column a and d would macth? And if
there is no match then it would leave the other columns empty

Like this

col a---col b col d---col e
001 a
002 k
020 f
041 i 041 l
554 p

I need your help very much!
-Dave
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 751
Default How to sort data according two matching cells?

On Jun 6, 9:03 am, Dave wrote:
Hi,

I have this problem with sorting my data. I have data that is in two lists
like

col a---col b col d---col e
001 a 002 k
020 f 041 l
041 i 554 p

How can I sort all this data so that both column a and d would macth? And if
there is no match then it would leave the other columns empty

Like this

col a---col b col d---col e
001 a
002 k
020 f
041 i 041 l
554 p

I need your help very much!
-Dave


Dave,

A quick and dirty one: Assuming list1 is in A1:B5, list2 in D1:E4.

Use an aux column (say starting from F1):

=SMALL(($A$1:$B$5,$D$1:$E$4),ROW()-ROW($F$1)+1)

Copy down until you get #NUM!

In H1:
=IF(COUNTIF($A$1:$B$5,F1),F1,"")
In I1:
=IF(H1,VLOOKUP(H1,$A$1:$B$5,2,0),"")

In K1:
=IF(COUNTIF($D$1:$E$4),F1),F1,"")
In L1:
=IF(K1,VLOOKUP(K1,$D$1:$E$4,2,0),"")

HTH
Kostis Vezerides

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 12
Default How to sort data according two matching cells?

Thank you very much for your help Vezerid! I'll try the solution immediately

-Dave


"vezerid" wrote:

On Jun 6, 9:03 am, Dave wrote:
Hi,

I have this problem with sorting my data. I have data that is in two lists
like

col a---col b col d---col e
001 a 002 k
020 f 041 l
041 i 554 p

How can I sort all this data so that both column a and d would macth? And if
there is no match then it would leave the other columns empty

Like this

col a---col b col d---col e
001 a
002 k
020 f
041 i 041 l
554 p

I need your help very much!
-Dave


Dave,

A quick and dirty one: Assuming list1 is in A1:B5, list2 in D1:E4.

Use an aux column (say starting from F1):

=SMALL(($A$1:$B$5,$D$1:$E$4),ROW()-ROW($F$1)+1)

Copy down until you get #NUM!

In H1:
=IF(COUNTIF($A$1:$B$5,F1),F1,"")
In I1:
=IF(H1,VLOOKUP(H1,$A$1:$B$5,2,0),"")

In K1:
=IF(COUNTIF($D$1:$E$4),F1),F1,"")
In L1:
=IF(K1,VLOOKUP(K1,$D$1:$E$4,2,0),"")

HTH
Kostis Vezerides


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
A 2-Column Matching Sort ConfusedNHouston Excel Discussion (Misc queries) 2 January 16th 07 10:46 PM
matching cells and transfering data Hurler99 Excel Worksheet Functions 2 January 11th 07 08:30 PM
How do I compare data in two worksheets to find matching cells? Gary Excel Discussion (Misc queries) 4 March 2nd 06 09:04 PM
Matching data and linking it to the matching cell yvonne a via OfficeKB.com Links and Linking in Excel 0 July 13th 05 07:30 PM
sort data in cells in a row Cactus Excel Worksheet Functions 3 June 6th 05 03:04 AM


All times are GMT +1. The time now is 06:11 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"