# Formula for finding number in array

Hi. I have a list of unique numbers in a range i.e. A1A15. I need to check if each number exists in another range, with unique number i.e. E1:L1. By unique numbers, I mean that the number won't be expressed again in that range - there's only one of that number. If the number is found, for the value to be expressed as 1 and if not, to be expressed as 0.

I've used 'match' and 'lookup', however I keep encountering '#N/A' if the number is not found. The '#N/A' interferes with percentage calculations I'm using to generate a score. What am I missing, or is there another formula that I should be using?

=IF(MATCH(\$A3,\$E\$1:\$L\$1,0)=1,1,0)
=IF(LOOKUP(A3,E1:L1),"Y","N")
###### Who is Participating?

x
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.

Remote Training and ProgrammingCommented:
``````=IF(ISERROR((\$A3,\$E\$1:\$L\$1,0)),0,1)
``````
``````=IF(ISERROR((\$A3,\$E\$1:\$L\$1,0)),0,1)
``````
Remote Training and ProgrammingCommented:
oops!

``````=IF(IsError(MATCH(\$A3,\$E\$1:\$L\$1,0)),0,1)
``````
``````=IF(ISERROR((\$A3,\$E\$1:\$L\$1,0)),0,1)
``````

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.

Remote Training and ProgrammingCommented:
I don't now why it is putting this twice ... new to the forum, my apologies.

Anyway, wrap the MATCH with ISError.  If true, then you want 0.  If False, then the match was found and you want 1.
``````=IF(ISERROR((\$A3,\$E\$1:\$L\$1,0)),0,1)
``````
Remote Training and ProgrammingCommented:
the code snippet above it not correct ... don't know why it got included!  Just read what I wrote ... one of the code examples is right and the others came from me mistakenly including a snippet.  I didn't mean to do that!

Because I am new, I cannot edit my posts ... hopefully you see to use IsError :)
Author Commented:
=IF(IsError(MATCH(\$A3,\$E\$1:\$L\$1,0)),0,1)

That worked out very well. Thanks for your quick response and assistance. Much appreciated.
Remote Training and ProgrammingCommented:
thank you, Osley and you're welcome ~ happy to help
Analyst Assistant Commented:
The MATCH function will not tell you if a value can only be found once in a range.

If a value appears more than once MATCH will return the position of the first occurrence.
Remote Training and ProgrammingCommented:
this will return 1 if the value is also unique and 0 if it is not

``````=IF(COUNTIF(\$E\$1:\$L\$1,\$A3)=1,1,0)
``````
###### 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 Excel

From novice to tech pro — start learning today.