Solved

Excel if coumn N = 1 and Column O = 0 then....

Posted on 2013-12-13
7
155 Views
Last Modified: 2014-01-29
Hi All,

Im tryign to search a colum to find out if it contains a value.

My theroy is to seach column N to see if it contains "1" if it does search Column O to see if anything the 1 contians a 0 in column O

I tried this but throws an error...

=IF(Result!N2:N1000=”1”,(If(Result!o2:o1000=”0”,Yes,No))

Open in new window



Example would be
*************
N O
1  1
1  4
1  1
2  0
********
The above would return no as N contains no 0's IN column O where coumn N = 1

*************
N O
1  1
1  0
1  1
2  0
********
The above would return yes as N contains no a 0 IN column O where coumn N = 1
0
Comment
Question by:runnerjp2005
7 Comments
 
LVL 43

Expert Comment

by:Saqib Husain, Syed
ID: 39716407
Try

=sumproduct((n2:n1000=1)*(o2:o1000=0)*1)
0
 
LVL 43

Expert Comment

by:Saqib Husain, Syed
ID: 39716418
If you have 2007 or later then you can also try

=COUNTIFS(O2:O1000,0,N2:N1000,35)

That should give you the number of lines found. If you just need a yes or no then try

=if(COUNTIFS(O2:O1000,0,N2:N1000,35),"Yes","No")
0
 
LVL 11

Expert Comment

by:Angelp1ay
ID: 39716644
I think your 35 should be a 1??
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 43

Expert Comment

by:Saqib Husain, Syed
ID: 39716726
You are right
0
 

Expert Comment

by:TAOSA-Admin
ID: 39716727
IF(logical test, value if true, value if false)

=IF1(logical test1 Result!N2:N1000=”1”,value if true1(If2(logical test 2Result!o2:o1000=”0”,value if true 2 Yes,value if false 2 No), value if false1)

You appear to have no value if false for the outer IF statement and a missing trailing close parenthesis.  Every left (open parenthesis) shoudl have a matching right (close parenthesis).  You have three lefts and two rights.
0
 

Author Comment

by:runnerjp2005
ID: 39716978
I did =IF(COUNTIFS(O2:O1000,0,N2:N1000,1),"Yes","No")

but it says no when it should say yes!!!

Aaatched is the sheet
J.P.B.S.xlsx
0
 
LVL 11

Accepted Solution

by:
Angelp1ay earned 500 total points
ID: 39717071
Two problems:

Your references are wrong. You moved the formula to a different sheet. You need to change the formula to point to the Result sheet:
=IF(COUNTIFS(Result!O2:O1000,0,Result!N2:N1000,1),"Yes","No")

Open in new window


By your logic in the sheet you posted it actually should say no (you don't have any 0s in col O next to 1s in col N).

With the references corrected, when I put a 0 in col O it does switch to Yes.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Microsoft Office Picture Manager is not included in Office 2013. This comes as a shock to users upgrading from earlier versions of Office, such as 2007 and 2010, where Picture Manager was included as a standard application. This article explains how…
No matter the version of Windows you are using, you may have some problems with Windows Search running too slow or possibly not running at all. Before jumping into how you can solve this issue, just know there are many other viable alternative deskt…
The viewer will learn how to  create a slide that will launch other presentations in Microsoft PowerPoint. In the finished slide, each item launches a new PowerPoint presentation and when each is finished it automatically comes back to this slide: …
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.

863 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

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now