Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I would like to write an if statement for the following. I have two columns of names. One column has 169 names and the other has 409. I need to make sure that the column with the 169 names, that those names are in the column which contains the names of the 409 people.
Any advice?

Hi,
If your short list of names is in column A, starting at A1
and
your long list of names is in column D,
put this formula in Cell B1:
=IF(ISNA(VLOOKUP(A1,$D$1:$D$408,1,FALSE)),"Missing","")
Note the $ signsThen drag the formula down the 169 rows required,
Alongside any names in column A that do not appear in column D you will get the word 'missing'
Vlookup returns the #NA error if it does not find a match.
Using the ISNA function returns TRUE if Vlookup can't find a match and returns #NA
The if function returns "Missing" if ISNA returns True (and "" if False, i.e. if Vlookup found a match).Regards

Or, similar to Humar's suggestion, you could select the 169 names that start in A1, and use:
Format...Conditional Formatting...Formula Is...
=IF(ISNA(VLOOKUP(A1,$D$1:$D$408,1,0)),TRUE,FALSE)
and choose a Format, such as Pattern...Yellow.
Click OK
Any name that isn't found in D1:D408 will take on the Format chosen.

![]() |
.xls file opening problem...
|
removing watermarks from ...
|
| Login or Register to Reply | |
| Login | Register |
| Ads by Google |