Comparing two Columns and returning

Data_Dude

New Member
Joined
Sep 9, 2011
Messages
3
Hello,

I could really use some help on a formula, I guess it can be done by a combination between VLOOKUP and IF but i can't make it work. :confused:

So what I want to do is compare 2 columns that have the same values but in a different order and return in a 3rd column the same values but in the order of the first column, this may sound odd but it would help me a lot.

Here is a ex.

Column A Column B Column C
123 143 123
132 123 132
143 132 143

So basically compare column B with Column A and return in Column C the values from column B but in the order of Column A.

Help is really appreciated
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
Compare and withdraw.

Hello,

I could really use some help on a formula, I guess it can be done by a combination between Indexing and match but i can't make it work.

So what I want to do is compare 2 columns that have the same values but in a different order and return in a 3rd column the same values but in the order of the first column, this may sound odd but it would help me a lot.

Here is a ex.

Column A Column B Column C
123 ----- 143 ----- 123
132 ----- -----
143 ----- 123 ----- 143

So basically compare column B with Column A and return in Column C the values from column B but in the order and the same line as Column A.

Help is really appreciated

P.S. VoG gave me a answer, at first it was oki but I forgot to take in account that I Column B may contain only half of the numbers from Column A, so if I would use this =INDEX($A$1:$A$16,MATCH(B2,$B$1:$B$28,0)) and I want to get only the numbers from column B in the same line and order as in A it won't do the trick, VoG I apologize I forgot to mention this important fact.

Here is the example of what I get by using =INDEX($A$1:$A$16,MATCH(B2,$B$1:$B$28,0))


Column A Column B Column C
123 ----- 143 ----- 123
132 ----- 123 ----- 132
143 ----- -----

Because the formula found the value 143 in column A it withdraw the value from the line 1 of Column A as the MATCH function defies it.

So correctly the Column C should withdraw the values 143 and 123 but on the lines on which they are on column A so in the case above 143 should appear on C3.

Please help !!!!!!!
 
Upvote 0
I have merged your two threads together.

Per forum rules, all clarifications, dependent follow-ups, or bumps should be posted back to the original thread (so the people who have been helping you can see you still need help!). You should only start a new thread for a brand-new unrelated question. Threads of a duplicate nature will be locked or deleted.
http://www.mrexcel.com/forum/showthread.php?t=99490
 
Upvote 0

Forum statistics

Threads
1,224,516
Messages
6,179,231
Members
452,898
Latest member
Capolavoro009

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