Help - Search - Members - Calendar
Full Version: Countif Question
Suggest A Fix PC Support Forums > General Computing > Applications and Office Programs
Lemur
Hi,

I have a question – can the COUNTIF function ever be used to check for TWO variables?

Here’s the situation.

There are 12 ‘people’ – and each has rated a game each time they’ve played it. Some have never played a particular game and others have played games multiple times.

I’ve set up the subtotals so it reveals what each person’s average rating is – and that’s fine. NOW, I want to set it up so that it reveals how many times a particular person played that particular game.

So…in column A is the game name, column B is the publisher and column C is the Average from the subtotals page. (I can email this to anyone who would like to see it)

Column D is the tricky one. It currently reads:

=COUNTIF('Player Ratings'!$A$2:$A$429,A2)

Basically, it’s checking for that particular game name in the master list of game names. HOWEVER, I’d like to also ONLY have a count made for the # of times that game has been played by that person.

For example, in Sheet 1 – “Chris” – you can see that for some of the games, there are no ratings assigned, but the # Plays is still reflecting a number, because it SEES the game name.

Instead, I need the COUNTIF function to check the “Player Ratings” sheet, and – report back how many times the game name appears WHEN the specific person has recorded a rating for it – otherwise, the cell should be blank.

To further illustrate, in column F, I’ve set up what the values SHOULD be (although, this is entered manually, and NOT by formula).

How can I do this easily? I’m assuming the AND function works in here someways, but I’m just having difficulty getting my head around it!

Chris

Lemur
OK - I figured it out...after hunting and searching all morning, I tried something, and it worked:

The formula is (and you have to hit Ctrl+Shift+Enter to get it to be an 'array'):

=SUM(IF('Player Ratings'!$A$2:$A$429=A14,IF('Player Ratings'!$J$2:$J$429<>"x",1,0),0))

Which presents as

{=SUM(IF('Player Ratings'!$A$2:$A$429=A14,IF('Player Ratings'!$J$2:$J$429<>"x",1,0),0))}

In the cell...

The only negative thing, is that I would've liked it to report back an empty cell, instead of a '0' whenever there weren't any playings; but, I'll take it this way!

Thanks!

Chris
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.