IF Statement

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm attemptiing a formula which looks like the following:

Iif(([panel])=1,count([working on contact]),"")

I have two columns in a Form. THe formula is in a unbound text field.
Basically what I want is if a panel is equal to 1 then count the working on
contact column. I've also tried sum as well. Here is an example of the
columns. The above formula should yield an answer of 3. Instead it counts
all of them and comes up with 5. I've tried count, dcount, countif, and even
abs and not to mention all sorts of combintations, but I'm stuck. Please
help.

Panel Working on Contact
1 1
1 1
1 1
4 1
4 1

If Panel = 1 then count Working on Contact which equals 3.
 
I'm attemptiing a formula which looks like the following:

Iif(([panel])=1,count([working on contact]),"")

I have two columns in a Form. THe formula is in a unbound text field.
Basically what I want is if a panel is equal to 1 then count the working on
contact column. I've also tried sum as well. Here is an example of the
columns. The above formula should yield an answer of 3. Instead it counts
all of them and comes up with 5. I've tried count, dcount, countif, and even
abs and not to mention all sorts of combintations, but I'm stuck. Please
help.

Panel Working on Contact
1 1
1 1
1 1
4 1
4 1

If Panel = 1 then count Working on Contact which equals 3.

Do you wish to count how many [Panel] = 1's there were?
=Sum(IIf([Panel]=1,1,0))

or do you wish to add up the values in [Working on contact]?
=Sum(IIf([Panel] =1,[Working on Contact],0))
 
The last formula you wrote worked perfectly. Thanks for the help - you saved
the day.

fredg said:
I'm attemptiing a formula which looks like the following:

Iif(([panel])=1,count([working on contact]),"")

I have two columns in a Form. THe formula is in a unbound text field.
Basically what I want is if a panel is equal to 1 then count the working on
contact column. I've also tried sum as well. Here is an example of the
columns. The above formula should yield an answer of 3. Instead it counts
all of them and comes up with 5. I've tried count, dcount, countif, and even
abs and not to mention all sorts of combintations, but I'm stuck. Please
help.

Panel Working on Contact
1 1
1 1
1 1
4 1
4 1

If Panel = 1 then count Working on Contact which equals 3.

Do you wish to count how many [Panel] = 1's there were?
=Sum(IIf([Panel]=1,1,0))

or do you wish to add up the values in [Working on contact]?
=Sum(IIf([Panel] =1,[Working on Contact],0))
 

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

Back
Top