Looking to compare 2 Column and find closest match then sort

skyfleo

New Member
Joined
May 17, 2022
Messages
7
Office Version
  1. 2021
Platform
  1. Windows
hello , I have this 2 list ,and I want the same word to be in the same row ( Ex : row 1 contains : "Service 351" in A1 and "Service 82" in B1 ) , please help and ty ♥

1652791272104.png
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
If you separately sort each of the two columns, would you get the result that you need?
 
Upvote 0
I need to keep those numbers , each row should contain 2 same names + the numbers like this :
1652797388785.png
 
Upvote 0
And wouldn't sorting each of the columns get that result?
 
Upvote 0
Try in D1:
Excel Formula:
=INDEX($A$1:$A$100,MIN(IF((LEFT(SUBSTITUTE($A$1:$A$100," ",REPT(" ",50)),50)=LEFT(SUBSTITUTE(B1," ",REPT(" ",50)),50)),ROW($A$1:$A$100),"")))
To be confirmed by Contr-Shift-Enter, nor Enter alone
This assume a max of 100 items in column A; adapt those $100 to higher value, in case that 100 is not enough

In E1, of course:
=B1
 
Upvote 0
it
Try in D1:
Excel Formula:
=INDEX($A$1:$A$100,MIN(IF((LEFT(SUBSTITUTE($A$1:$A$100," ",REPT(" ",50)),50)=LEFT(SUBSTITUTE(B1," ",REPT(" ",50)),50)),ROW($A$1:$A$100),"")))
To be confirmed by Contr-Shift-Enter, nor Enter alone
This assume a max of 100 items in column A; adapt those $100 to higher value, in case that 100 is not enough

In E1, of course:
=B1
1652799112634.png

Nothing happen the 2 column are still the same not sorted like I want :/
 
Upvote 0
Retry:
Excel Formula:
=IFERROR(INDEX($A$1:$A$100,IF(MIN(IF((LEFT(SUBSTITUTE($A$1:$A$100," ",REPT(" ",50)),50)=LEFT(SUBSTITUTE(B1," ",REPT(" ",50)),50)),ROW($A$1:$A$100),""))=0,-1,MIN(IF((LEFT(SUBSTITUTE($A$1:$A$100," ",REPT(" ",50)),50)=LEFT(SUBSTITUTE(B1," ",REPT(" ",50)),50)),ROW($A$1:$A$100),"")))),"")

Using Office 365 its lenght would be cut by 3
 
Upvote 0

Forum statistics

Threads
1,214,992
Messages
6,122,631
Members
449,095
Latest member
bsb1122

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
Back
Top