"add parenthesis"

P

PatrickP

I type in the following formula and keep getting the error message that it is
missing a parenthesis. No error message when using the "pop up" window to
assist with the formula but when I hit "enter" I get the parenthesis
notification. However, I have added them everywhere I can think of it is
still getting rejected. BTW, what I am trying to tell Excel is "If there is
a 0 in one cell AND an X in another cell, count it."

=COUNTIF(AND(Attendance!D6=0,Violations!C6="X")

What am I mising?
 
P

Pete_UK

You can't use COUNTIF like that - it only works with one condition,
and you normally apply that condition over a range. Try this instead:

=SUMPRODUCT((Attendance!D6:D100=0)*(Violations!C6:C100="X"))

this checks the ranges from rows 6 to 100 and counts if the criteria
are met.

Hope this helps.

Pete
 
D

David Biddulph

Pete has commented on what formula you need, but to answer your original
question about the parentheses, they need to come in pairs, so for every
opening parenthesis [ ( ] you need a closing one [ ) ]. You've got 2
opening and one closing.

You can't, of course, just scatter parentheses at random, and you'll need to
check in Excel help what the syntax of each Excel function is, and make sure
that the appropriate parameters are given for each function, separated where
necessary by commas and surrounded where necessary by parentheses.

In your case your AND function is there with valid syntax, with 2 boolean
conditions separated by a comma and surrounded by parentheses, but you would
need to remind your self what parameters COUNTIF is looking for (a range and
a criterion), and that would need to be suitably punctuated.
 
P

PatrickP

Pete:

With a minor modification regarding the range, that seems to have done the
trick. Thank you so much!
 
T

Tyro

Regardless of the problem with your formula, look at it! You have two (2)
left parentheses and one (1) right parenthesis. Parentheses must be
balanced, an equal number of left and right parentheses.

Tyro
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top