English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

does anyone know how to get excel to count the number of occurances of a value dependant on a condition? eg two columns of data one is gender the other is nationality, I want to count the number of female british and male italians.

2006-06-16 00:01:07 · 12 answers · asked by slbrooks10 1 in Computers & Internet Software

filters are good but can't use for producing charts
sumif and countif work in individual columns but not with condition nor do array formulas

2006-06-16 00:11:08 · update #1

counting males in one gender column is ok, can do that fine, and the same in the nationality column, would like to give condition to this count, eg male and italian or female and thai or whatever!

sushine - would love to contact you but for some reason can't through this you might need to check your contact options in the profile section!!

2006-06-16 00:19:15 · update #2

12 answers

I have listed a few tutorial sites in the list of sources but probably the best is this one:
http://www.bized.ac.uk/timeweb/excel.htm

2006-06-16 00:40:24 · answer #1 · answered by halifaxed 5 · 1 0

Three ways to do this:

1. Pivot Tables. I wrote another answer explaining the basics of using them. See the link.

2. SumProduct formula. SumProduct is SumIf on steroids. SumProduct can use multiple criteria, unlike SumIf.

Suppose Gender is in column A and Nationality is in column B. In Cell C1, type in:
=SUMPRODUCT ((A2:A5000="Male")*( B2:B5000="Italian")*1))
and drag down to row 5000

Column C will have a 1 or 0 depending on the results of both comparisons.

NOTES:
Range MUST start in row 2
Both ranges MUST be equal (i.e. 5000)
Ranges can be as large as you need them to be
Do not use too many of these formulas as your calculation time will slow down to a crawl.

3. If calculation is too slow, do a similar comparison with formulas that are not loaded into memory (like SumProduct) if your comparisons are simple.

To find British females,
=if(and(A1="Female", B1="British"),1,0)

To find British and Italian females, things get a bit more complex
=if(or(and(A1="Female",B1="British"), and(A1="Female", B1="Italian")),1,0)

The second formula basically has two AND functions nested insise an OR function.

Hmmm...now that I think of it, you could rewrite it as:
=IF(AND(A1="Female", OR(B1="British",B1="Italian")),1,0)

Hope this helps. Send me an email if you need more help.

2006-06-16 11:58:21 · answer #2 · answered by icepero 3 · 0 0

I agree with previous person sushant - pivot tables the way to go. Once you start using them - u'll never look back. Pivot tables offer you a summary table - where you can drill down on the specific totals to get a list of that total only. Good news is they can work on lists longer than your standard excel page - but then you need MS Access for that.

2006-06-16 03:26:01 · answer #3 · answered by fruit&nut 3 · 0 0

There's a useful function COUNTIF which counts based on a criteria you set. There's also a SUMIF function which does the same but sums rather than counts

2006-06-16 00:07:29 · answer #4 · answered by Darren C 5 · 0 0

in case you're speaking about video clips, CDs, etc. that's prohibited. that's stealing the paintings of different individuals. some day, once you're making a video, someone would pirate it and earn better money from it than you'll. in case you're speaking about piracy on the intense seas..... actually everyone appears commonly used with in reality the romanticized variations of piracy that they see in video clips, and picture that all pirates seem as if action picture stars. they are blind to the cruelty of authentic pirates, who were a murderous bunch of reduce-throats and entirely and not using a shred of human decency. They were the dregs of society who were hanged by ability of the neck until eventually lifeless at the same time as they were stuck. There are nevertheless authentic-existence pirates off the coast of Africa and in the far East. I actually don't have any desire to satisfy any of them. Piracy is the worst style of armed robbery. human beings were tortured, maimed, and murdered. females were raped and murdered. definite, piracy is inaccurate and that's prohibited. Kidnapping, homicide, rape, torture, and robbery are crimes. what style of info do you elect and desire?

2016-10-14 05:23:31 · answer #5 · answered by ? 4 · 0 0

Click on the top toolbar data, then filter, then auto filter. You will then have filters on each column so you can pick what info you require

2006-06-16 00:06:36 · answer #6 · answered by Ju 2 · 0 0

Use the OR function.
OR(c4="female",d4="british")
Then do a countif on "TRUE"

2006-06-16 00:18:29 · answer #7 · answered by Anonymous · 0 0

this sounds more like a database appication not a spreadsheet app.

2006-06-18 04:12:20 · answer #8 · answered by zippyy 2 · 0 0

Hey, Pivot tables is the best way to sovle your problem. If you want to know how to use them, please feel free to contact me on my ID. CHeers

2006-06-16 00:07:44 · answer #9 · answered by sushant 1 · 0 0

you have to use a formula eg. A1+B1=C1

2006-06-16 00:07:20 · answer #10 · answered by deathdealer 5 · 0 0

fedest.com, questions and answers