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.
AB
JohnRobert
TinaGreg
GregMike
KenKen
AvrilJohn

<tbody>
</tbody>

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
C
John
Ken
Greg

<tbody>
</tbody>



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

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
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,216,045
Messages
6,128,484
Members
449,455
Latest member
jesski

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