# If statement to find matching values in columns in Excel

Excel -  I need to look at a list of IDs  find then in another column and then place an 'X' in another column if found.
Example

Look at column   AT   if you find a match in column   C   put a   X   in column  AL

Column C      Column AL      Column AT
123                           X                    123
123                           X                    345
456                                                  234
789                                                  567
987                                                  321
654
321                            x
321                            x
321                            x
###### Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Commented:
Try the following formula in column AL

IF(ISNA(VLOOKUP(C1,AT\$1:AT\$5,1,FALSE)),"","X")

Change C1 to the correct row number (e.g. C2 or whatever the row number you are starting at)
Change AT\$1:AT\$5 to be the range you want to look for values in (e.g. if the lookup range starts at row 10 and goes to row 20 the formula would be AT\$10:AT\$20)
CoordinatorAuthor Commented:
I get an error about to many arguments

=IF(ISNA(VLOOKUP(C2,AT\$2:AT\$913),1,FALSE)),"","X")
Commented:

=IF(ISNA(VLOOKUP(C2,AT\$2:AT\$913,1,FALSE)),"","X")

I screwed up my initial post which I have since revised.

Experts Exchange Solution brought to you by

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

CoordinatorAuthor Commented:
=IF(ISNA(VLOOKUP(C2,AT\$2:AT\$913,1,FALSE),"","X")

Still getting the same error?????
Commented:
Sorry, I had a typo in my last response which I've since corrected. You need to add another closing bracket after the FALSE
CoordinatorAuthor Commented:
Got it!  Thanks!!
Excel & VBA ExpertCommented:
Another variation you may try is this...

``````=IF(ISNUMBER(MATCH(C2,AT:AT,0)),"X","")
``````
OR simply this...
``````=IF(COUNTIF(AT:AT,C2),"X","")
``````
Using VLookup for a single column table_array doesn't make much sense. All you need is to confirm whether a number exists in another column or not so in that case either you may use MATCH or COUNTIF function to confirm this.
CoordinatorAuthor Commented:
Thanks for comment and explanation.
Excel & VBA ExpertCommented:
You're welcome!
###### It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Office

From novice to tech pro — start learning today.