Solved

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

Posted on 2013-12-13
7
144 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
Comment Utility
Try

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

Expert Comment

by:Saqib Husain, Syed
Comment Utility
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
Comment Utility
I think your 35 should be a 1??
0
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 
LVL 43

Expert Comment

by:Saqib Husain, Syed
Comment Utility
You are right
0
 

Expert Comment

by:TAOSA-Admin
Comment Utility
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
Comment Utility
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
Comment Utility
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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

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…
Using Word 2013, I was experiencing some incredible lag when typing.  Here's what worked for me....
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.

772 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

9 Experts available now in Live!

Get 1:1 Help Now