ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   "add parenthesis" (https://www.excelbanter.com/excel-worksheet-functions/173619-add-parenthesis.html)

PatrickP

"add parenthesis"
 
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?

Pete_UK

"add parenthesis"
 
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

On Jan 18, 4:58*pm, PatrickP
wrote:
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?



David Biddulph[_2_]

"add parenthesis"
 
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.
--
David Biddulph

"PatrickP" wrote in message
...
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?




PatrickP

"add parenthesis"
 
Pete:

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

"Pete_UK" wrote:

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

On Jan 18, 4:58 pm, PatrickP
wrote:
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?




Pete_UK

"add parenthesis"
 
You're welcome, Patrick - thanks for feeding back.

Pete

On Jan 18, 11:05*pm, PatrickP
wrote:
Pete:

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



"Pete_UK" wrote:
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


On Jan 18, 4:58 pm, PatrickP
wrote:
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?- Hide quoted text -


- Show quoted text -



Tyro[_2_]

"add parenthesis"
 
A right parenthesis. Regardless of the formula as to wether or not it makes
sense, look at your formula, you see two left parentheses and only one right
parenthesis. Parentheses must be balanced. The number of left parentheses
must be matched by an equal number of right parentheses. The innermost
parentheses say "Do me first" then go to the next higher level. All
functions must have a left and right parenthesis. Thus AND requires the two
and so does COUNTIF.

Tyro

"PatrickP" wrote in message
...
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?




Tyro[_2_]

"add parenthesis"
 
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

"PatrickP" wrote in message
...
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?





All times are GMT +1. The time now is 03:44 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com