And Statement

G

Guest

I've looked at the below statement too many times and I can't figure out why
it won't work. I've tried using AND as well. I have 10 regions broken out
by west, central, and east. I need it to pull all the regions I specify and
count the number of wins. What appears to be happening is that it only pulls
in the wins for the first region listed, North East and doesn't count the
remaining.

=(Sum(IIf([Status]="wins" And [Region]="north east" Or "new england" Or
"Great Lakes" Or "North East",1,0)))

I've tried the below as well but no luck:
=(Sum(IIf([Status]="wins" And [Region]="north east" And [Region]= "new
england" And [Region]= "Great Lakes" And [Region]= "North East",1,0)))

I hate to post questions but I do give it my best try before coming to you
all. I admit I have some trouble with the complicated formulas. Thanks for
your time and help!
 
G

Guest

Try this

=Sum(IIf([Status]="wins" And ([Region]="north east" Or "new england" Or
"Great Lakes" Or "North East"),1,0))
 
G

Guest

It appears that it adds anything with a status of "wins" but doesn't test for
region. B/c I get a total of 19 (and that happens to be the total of all 10
regions) not just the ones specified below. Any more ideas? Thanks! I am
still trying as well.

Ofer said:
Try this

=Sum(IIf([Status]="wins" And ([Region]="north east" Or "new england" Or
"Great Lakes" Or "North East"),1,0))

--
In God We Trust - Everything Else We Test


_ said:
I've looked at the below statement too many times and I can't figure out why
it won't work. I've tried using AND as well. I have 10 regions broken out
by west, central, and east. I need it to pull all the regions I specify and
count the number of wins. What appears to be happening is that it only pulls
in the wins for the first region listed, North East and doesn't count the
remaining.

=(Sum(IIf([Status]="wins" And [Region]="north east" Or "new england" Or
"Great Lakes" Or "North East",1,0)))

I've tried the below as well but no luck:
=(Sum(IIf([Status]="wins" And [Region]="north east" And [Region]= "new
england" And [Region]= "Great Lakes" And [Region]= "North East",1,0)))

I hate to post questions but I do give it my best try before coming to you
all. I admit I have some trouble with the complicated formulas. Thanks for
your time and help!
 
D

Duane Hookom

Won't work that way either.

=Sum(IIf([Status]="wins" And ([Region]="north east" Or [Region]="new
england" Or [Region]="Great Lakes" Or [Region]="North East"),1,0))
or possibly
=Sum(IIf([Status]="wins" And [Region] IN ("north east","new england","Great
Lakes", "North East"),1,0))

--
Duane Hookom
MS Access MVP
--

Ofer said:
Try this

=Sum(IIf([Status]="wins" And ([Region]="north east" Or "new england" Or
"Great Lakes" Or "North East"),1,0))

--
In God We Trust - Everything Else We Test


_ said:
I've looked at the below statement too many times and I can't figure out
why
it won't work. I've tried using AND as well. I have 10 regions broken
out
by west, central, and east. I need it to pull all the regions I specify
and
count the number of wins. What appears to be happening is that it only
pulls
in the wins for the first region listed, North East and doesn't count the
remaining.

=(Sum(IIf([Status]="wins" And [Region]="north east" Or "new england" Or
"Great Lakes" Or "North East",1,0)))

I've tried the below as well but no luck:
=(Sum(IIf([Status]="wins" And [Region]="north east" And [Region]= "new
england" And [Region]= "Great Lakes" And [Region]= "North East",1,0)))

I hate to post questions but I do give it my best try before coming to
you
all. I admit I have some trouble with the complicated formulas. Thanks
for
your time and help!
 
G

Guest

Thanks - I tried the first one and it worked!

Duane Hookom said:
Won't work that way either.

=Sum(IIf([Status]="wins" And ([Region]="north east" Or [Region]="new
england" Or [Region]="Great Lakes" Or [Region]="North East"),1,0))
or possibly
=Sum(IIf([Status]="wins" And [Region] IN ("north east","new england","Great
Lakes", "North East"),1,0))

--
Duane Hookom
MS Access MVP
--

Ofer said:
Try this

=Sum(IIf([Status]="wins" And ([Region]="north east" Or "new england" Or
"Great Lakes" Or "North East"),1,0))

--
In God We Trust - Everything Else We Test


_ said:
I've looked at the below statement too many times and I can't figure out
why
it won't work. I've tried using AND as well. I have 10 regions broken
out
by west, central, and east. I need it to pull all the regions I specify
and
count the number of wins. What appears to be happening is that it only
pulls
in the wins for the first region listed, North East and doesn't count the
remaining.

=(Sum(IIf([Status]="wins" And [Region]="north east" Or "new england" Or
"Great Lakes" Or "North East",1,0)))

I've tried the below as well but no luck:
=(Sum(IIf([Status]="wins" And [Region]="north east" And [Region]= "new
england" And [Region]= "Great Lakes" And [Region]= "North East",1,0)))

I hate to post questions but I do give it my best try before coming to
you
all. I admit I have some trouble with the complicated formulas. Thanks
for
your time and help!
 

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