+ Reply to Thread
Results 1 to 9 of 9

Excel count query

Hybrid View

abirami Excel count query 02-25-2011, 01:52 AM
Okkitrooi Re: Excel count query 02-25-2011, 02:22 AM
davesexcel Re: Excel count query 02-25-2011, 04:21 AM
abirami Re: Excel count query 02-25-2011, 11:18 AM
davesexcel Re: Excel count query 02-26-2011, 07:21 AM
brokenbiscuits Re: Excel count query 02-25-2011, 11:30 AM
DonkeyOte Re: Excel count query 02-25-2011, 01:47 PM
mahju Re: Excel count query 02-25-2011, 02:10 PM
abirami Re: Excel count query 02-26-2011, 01:18 AM
  1. #1
    Registered User
    Join Date
    02-15-2010
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    14

    Excel count query

    I have a query. Kindly check the below example.

    In colum A, I have the following records
    ramu
    somu
    geetha
    ramu
    somu
    geetha
    ramu
    geetha
    somu
    In column B, I have the following records
    pass
    fail
    fail
    fail
    pass
    fail
    fail
    fail
    pass

    Now, I want to know, how many times did they fail depending the number of times their names appear in column A

    Kindly anyone provide solution ASAP, I'm waiting for it

  2. #2
    Registered User
    Join Date
    02-24-2011
    Location
    Brisbane, OZ
    MS-Off Ver
    Excel 2003-2010
    Posts
    2

    Re: Excel count query

    try in Column C

    =SUM(($A$1:$A$10=A1)*($B$1:$B$10="Fail"))

    exit with Shift+Ctrl+Enter

  3. #3
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,525

    Re: Excel count query

    =SUMPRODUCT((A1:A9="ramu")*(B1:B9="fail"))

    Ctrl&Shift&Enter is not required

  4. #4
    Registered User
    Join Date
    02-15-2010
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    14

    Re: Excel count query

    Thanks Dave... Its working...
    if there are 100 names then I have to change name for each cell?

    i.e (A1:A9="ramu') so I need to change ramu name into all the 100 people name?

    is there any other short cut for this?

  5. #5
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,525

    Re: Excel count query

    Quote Originally Posted by abirami View Post
    ...100 names then I have to change name for each cell?

    i.e (A1:A9="ramu') so I need to change ramu name into all the 100 people name?

    is there any other short cut for this?
    Replace "Ramu" with a cell reference such as (A1:A9=C1)

  6. #6
    Valued Forum Contributor
    Join Date
    10-13-2010
    Location
    Sunderland, England
    MS-Off Ver
    Excel 2007 (Home) / 2003 (Work)
    Posts
    740

    Re: Excel count query

    If you have a list of everyone's names, say in column C, you could use the formula in column D as such:

    =SUMPRODUCT(($A$1:$A$9=C1)*($B$1:$B$9="fail"))

    changing the '9' to the last row of data and dragging the formula down.

  7. #7
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Excel count query

    It would be best to use a Pivot Table - set Pass/Fail as a Report Filter (set to Fail) set Name as Row Field and Data Field set to Count.

    edit: for sake of transparency - attachment added
    Attached Files Attached Files
    Last edited by DonkeyOte; 02-25-2011 at 02:20 PM.

  8. #8
    Valued Forum Contributor mahju's Avatar
    Join Date
    11-27-2010
    Location
    Pakistan, Faisalabad
    MS-Off Ver
    Excel 2010 plus
    Posts
    730

    Lightbulb Re: Excel count query

    Provided your data is sorted on "Name" and then on "Result" (Pass/fail) then formula in "C1" will be:

    C1:
    =IF(AND(A1=A2,B1=B2),"",COUNT(IF(($B$1:B1=B1)*($A$1:A1=A1),($D$1:D1))))
    Array formula (Ctrl + Shift + Enter) copied down as you wish
    It will add total at each level change as subtotal command

    regards
    Mark the thread as solved if you are satisfied with the answer.


    In your first post under the thread tools.

    Mahju

  9. #9
    Registered User
    Join Date
    02-15-2010
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    14

    Re: Excel count query

    Thanks all for your response.... Now itmakes my job eassy!!!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1