Solved

IF Statement Excel

Posted on 2013-12-04
5
212 Views
Last Modified: 2013-12-04
Hello,

I would like to check to see whether the value in Cell A3 is present at all in the range of cells (A2:N24) on the Week1 worksheet as below.


=IF(A3=('Week 1'!A2:N24),"Yes","No")

However it always returns no because I think it is looking for the condition of that value being in every cell in that range?

Can someone please point me in the right direction on the right formula? I just want to confirm that the value present in cell A3 is in atleast one of the cells in range  'Week 1'!A2:N24'.

Regards,

GISVPN
0
Comment
Question by:gisvpn
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 50

Accepted Solution

by:
barry houdini earned 125 total points
ID: 39695666
Try using COUNTIF like this

=IF(COUNTIF('Week 1'!A2:N24,A3)>0,"Yes","No")

regards, barry
0
 
LVL 15

Assisted Solution

by:JimFive
JimFive earned 250 total points
ID: 39695685
The only way I can think of to do this is to put a formula at the bottom of each column:
=vlookup(A3, A2:A24, 1,false)
This will put the value found in the cell or #NA if not found.

And then put a formula to look for success
=if(isna(Hlookup(A3,A25:N25,1,false)),"No","Yes")
0
 
LVL 15

Assisted Solution

by:JimFive
JimFive earned 250 total points
ID: 39695691
Barry's is better.  Nice Solution
0
 
LVL 4

Assisted Solution

by:andrew_man
andrew_man earned 125 total points
ID: 39695708
=IF(COUNTIF(Week 1'!A2:N24,A3),"Yes","No")

no need greater than 0
0
 
LVL 50

Expert Comment

by:barry houdini
ID: 39695733
Note that is is also possible to use OR like this

=IF(OR(A3='Week 1'!A2:N24),"Yes","No")

but that needs to be "array entered" with CTRL+SHIFT+ENTER so COUNTIF is probably preferable in most cases.

"no need greater than 0"

that's true andrew_man, but sometimes I think the added clarity outweights the small space saving!

regards, barry
0

Featured Post

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How to get Spreadsheet Compare 2016 working with the 64 bit version of Office 2016
Outlook for dependable use in a very small business   This article is about using the Outlook application (part of Microsoft Office) in a very small business, or for homeowners where dependability and reliability are critical requirements. This …
Learn how to make your own table of contents in Microsoft Word using paragraph styles and the automatic table of contents tool. We'll be using the paragraph styles in Word’s Home toolbar to help you create a table of contents. Type out your initial …
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question