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")
OsleyAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

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.

crystal (strive4peace) - Microsoft MVP, AccessRemote Training and ProgrammingCommented:
=IF(ISERROR(($A3,$E$1:$L$1,0)),0,1)

Open in new window

=IF(ISERROR(($A3,$E$1:$L$1,0)),0,1)

Open in new window

crystal (strive4peace) - Microsoft MVP, AccessRemote Training and ProgrammingCommented:
oops!

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

Open in new window

=IF(ISERROR(($A3,$E$1:$L$1,0)),0,1)

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

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

Start your 7-day free trial
crystal (strive4peace) - Microsoft MVP, AccessRemote 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)

Open in new window

CompTIA Network+

Prepare for the CompTIA Network+ exam by learning how to troubleshoot, configure, and manage both wired and wireless networks.

crystal (strive4peace) - Microsoft MVP, AccessRemote 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 :)
OsleyAuthor 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.
crystal (strive4peace) - Microsoft MVP, AccessRemote Training and ProgrammingCommented:
thank you, Osley and you're welcome ~ happy to help
NorieAnalyst 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.
crystal (strive4peace) - Microsoft MVP, AccessRemote 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)

Open in new window

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.