PDA

View Full Version : countif only one field is this and another field is that


jasonc310771
08-27-2009, 02:54 PM
I have a test excel file attached here and would like to know how i create a piechart that would show stats of how many times each member turned up to our meetings.

each member would be shown in the chart as a seperate colour and have the count of times attended overall

but...

for each of the types of meetings.

there are three types

meet1, meet2, meet3

each meeting i would like to have its own chart

p1, p2, p3, p4 are the peoples initials i.e. AB, CB, DE, FG

and in the sheet the 'P' is present and 'A' is absent

what i do not understand is how i get the chart to count for all rows where each member has turned up for meet1, meet2 and meet3 accross the whole sheet?

can someone tell me how they would do this or where i would start, as i would like to learn how this is done instead of having it done for me. !

i have this so far but it counts all of the 'P' and not just ones in the rows with 'meet1'


thanks

ScottInTexas
08-30-2009, 02:53 PM
You can use the countfs function.
=COUNTIFS($B$8:$B$16,"meet1",C8:C16,"P")

The cells are a little different because I re-arranged the sheet a little. The countfs funcstion allows you to select several criteria. So in my example I say if the meeting column has meet1 and the person column has P then count it.

Have fun

jasonc310771
08-30-2009, 04:34 PM
i have put the following in to C1

=COUNTIFS($B$8:$B$16,"meet1",C8:C16,"P")

but it does not count the column it shows an error....

#NAME?

ScottInTexas
08-30-2009, 05:56 PM
Jason,

You have to adjust the code to fit your layout. As I said, I rearranged the data a little so I could put all three meetings above the data. Your code will be this =COUNTIFS(B6:B14, "meet1", C6:C14, "P")

The result in C1 will be 3. Notice the range is from Row 6 to Row 14 in Column B for the meeting and Row 6 to Row 14 in Column C for the P.

jasonc310771
08-30-2009, 06:54 PM
mmm..

i tried both

=COUNTIFS(B6:B14, "meet1", C6:C14, "P")

and the one with the $ in it and both show the error, attached file