compare 2 columns if the value is equal

kayza

Board Regular
Joined
Apr 29, 2015
Messages
61
Office Version
  1. 2007
Platform
  1. Windows
hi.
I want to compare the data I have in two different columns, let's say column A and column B, which in Column A contains old data, while column B contains the latest data and has some data that is not in column A.
[TABLE="width: 300"]
<tbody>[TR]
[TD]A[/TD]
[TD]B[/TD]
[/TR]
[TR]
[TD]John[/TD]
[TD]Robert[/TD]
[/TR]
[TR]
[TD]Tina[/TD]
[TD]Greg[/TD]
[/TR]
[TR]
[TD]Greg[/TD]
[TD]Mike[/TD]
[/TR]
[TR]
[TD]Ken[/TD]
[TD]Ken[/TD]
[/TR]
[TR]
[TD]Avril[/TD]
[TD]John[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]

and the result I want to show is that the data in column C only contains the same value and is written in ascending order, and more or less will look like the following
[TABLE="width: 200"]
<tbody>[TR]
[TD]C[/TD]
[/TR]
[TR]
[TD]John[/TD]
[/TR]
[TR]
[TD]Ken[/TD]
[/TR]
[TR]
[TD]Greg[/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
</tbody>[/TABLE]



Thank you in advance
sorry if this thread has been discussed in the forum
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
hi,

Use following array formula in column C. Press Ctrl+Shift+Enter not just enter

=IFERROR(INDEX($B$2:$B$6,LARGE(IFERROR(MATCH($A$2:$A$6,$B$2:$B$6,0),""),ROWS($A$2:A2))),"")

Change range as per your need.

Thanks
Swapnil Shah
 
Upvote 0
=IFERROR(INDEX($B$2:$B$6,LARGE(IFERROR(MATCH($A$2:$A$6,$B$2:$B$6,0),""),ROWS($A$2:A2))),"")

Hi Swapnil Shah.
Thanks for your quick response. it works. but the data did not display like I want to, which is it written in Ascending order.
 
Last edited:
Upvote 0
For given set of data , it gives output as desired , i.e. John,Ken,Gerg

IF you want your entire list to be alphabetically sorted , you can sort the out put column as per your need manually. By means of formula it'll be difficult to achieve.

Thanks
Swapnil Shah
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,323
Members
452,635
Latest member
laura12345

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