# Count the number of Girls and Boys in a spreadsheet

• 18th March 2011, 11:55 AM
EaglesNerd
Count the number of Girls and Boys in a spreadsheet
Does anyone have any idea of how to count the number of F's and M's in a single column then have a Girl and Boy key that relates to that column????? PLEASE HELP !
• 18th March 2011, 11:58 AM
pcstru
You want to look at the countif function. Typically you would have a cell set =countif(<range>,<criteria>). So if you have a column B with rows 1-10 containing gender values of either "M" or "F", you might have =countif("B1:B10","M"), which will give you the number of cells containing "M".
• 18th March 2011, 12:29 PM
LosOjos
As I posted in your other identical thread (why do that? It's SPAM!):

COUNTIF will do this, e.g.

Code:
for Male:
=COUNTIF(A1:A100,"M")

for Female:
=COUNTIF(A1:A100,"F")

you'll need to change the range accordingly.
• 22nd March 2011, 12:22 PM
El_Nombre
If you've got just "M" or "F" or "Boy" or "Girl" in the column, select the heading and then go Data > Filter > auto filter. Use the dropdown box that appears to select all the, say, "Girl" entries. The number of those particular entries will be displayed in the very bottom left of your screen, and now only those entries show (to clear that, select the dropdown arrow again which is now blue.) Fill the first cell in the column then drag to fill for the rest of the girls, repeat with boys, should all be good.

Quick and dirty way to do it if I'm actually getting what you needed.
• 22nd March 2011, 12:58 PM
sonofsanta
Could also use lists to do it... select the whole range, press Ctrl+L to turn it into a list, toggle total row on, set up a count in any column and then filter to just show the boys/girls. Quick n dirty if you just want to know the number, not so good if you're setting up a permanent cell (for which use countif, as others have said. that might just be easier anyway)