We will be migrating from Ask to Discourse on the first week of August, read the details here

Ask Your Question

Find values in Column B that are not in column A? [closed]

asked 2013-02-02 05:43:39 +0200

pueblonative gravatar image

updated 2021-06-25 17:54:55 +0200

Alex Kemp gravatar image

I guess I'm looking for a SQL Difference like function

I have column A with login ids

I have column B with all possible login IDs

I want to find a way to display in Column C which items in Column B are not being used. Would this require a function or a macro?

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by Alex Kemp
close date 2015-10-21 04:12:52.319237

1 Answer

Sort by » oldest newest most voted

answered 2013-02-02 10:39:47 +0200

razon_22 gravatar image

It can be done with the VLOOKUP function. Assuming there is no header row for the data, paste this function in cell C1.

=VLOOKUP(B1,$A$1:$A$100,1, )

If you have more than 100 rows of data, change the 100 in the formula to match the number of rows you have. Click in cell C1 then drag the handle down to the last row of data. This will copy the formula down. The function will look for the items in column B and see if they are in column A. If the item is found, column C will show the id, if not, it will show N/A. So the id's in column B that have N/A next to them are not being used.

edit flag offensive delete link more


Also you can use formula =COUNTIF($A$1:$A$100;B1)=0 Or if the number of values ​​in column A is less than 1024, you can use this method

JohnSUN gravatar imageJohnSUN ( 2013-02-04 08:36:03 +0200 )edit

This answer works well for me. The only hiccup that I encountered is that, for numeric data, I had to include FALSE as the final argument to VLOOKUP to indicate that my data is not sorted. Otherwise, false positives would appear where IDs were shown that did not match the lookup value exactly.

RNanoware gravatar imageRNanoware ( 2018-07-10 18:44:11 +0200 )edit

Question Tools


Asked: 2013-02-02 05:43:39 +0200

Seen: 24,173 times

Last updated: Feb 02 '13