## 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
Solved

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

Posted on 2013-12-13
169 Views
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))
``````

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
Question by:runnerjp2005

LVL 43

Expert Comment

ID: 39716407
Try

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

LVL 43

Expert Comment

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

ID: 39716644
I think your 35 should be a 1??
0

LVL 43

Expert Comment

ID: 39716726
You are right
0

Expert Comment

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

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

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")
``````

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

Question has a verified solution.

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

### Suggested Solutions

Recently Microsoft released a brand new function called CONCAT. It's supposed to replace its predecessor CONCATENATE. But how does it work? And what's new? In this article, we take a closer look at all of this - we even included an exercise file for…
Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.