+ Reply to Thread
Results 1 to 7 of 7

count the number of times a string occurs in a range based on a condition

  1. #1
    Registered User
    Join Date
    02-15-2011
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    17

    count the number of times a string occurs in a range based on a condition

    Please help.

    I am unable to count the number of times a string occurs in a range based on a condition. The constraint which I have is as below.


    Count the number of times "Passed to Training" occurs in column1 only if the corresponding field in column two is "Not Started"

    I have uploaded the file which I used. Please provide your valuable suggestions to achieve the requirement
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    09-27-2011
    Location
    Poland
    MS-Off Ver
    Excel 2007
    Posts
    1,312

    Re: count the number of times a string occurs in a range based on a condition

    Hi try
    =SUMPRODUCT((Phase2="Not Started")*(Phase1="Passed to Training"))
    Regards

    tom1977

    If You are satisfied with my solution click the small star icon on the left to say thanks.

  3. #3
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: count the number of times a string occurs in a range based on a condition

    in f11 =SUMPRODUCT((Phase1=E11)*(Phase2<>"notstarted")) note named ranges phase1/2 must be the same length or you'll have to use something like

    =SUMPRODUCT((A1:A70=E11)*(C1:C70<>"notstarted"))
    Last edited by martindwilson; 05-29-2012 at 03:58 AM.
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,428

    Re: count the number of times a string occurs in a range based on a condition

    In Excel 2003 you can use:

    =SUMPRODUCT(--(Phase1="Passed to Training"),--(Phase2="Not Started"))

    In 2007, you could use:

    =COUNTIFS(Phase1,"Passed to Training",Phase2,"Not Started")


    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  5. #5
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: count the number of times a string occurs in a range based on a condition

    Hi.

    Try this.

    =SUMPRODUCT((Phase1="Passed to Training")*(Phase2="Not Started"))

    Is this, works for you?
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  6. #6
    Registered User
    Join Date
    02-15-2011
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    17

    Re: count the number of times a string occurs in a range based on a condition

    Thanks for the quick replies.

  7. #7
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: count the number of times a string occurs in a range based on a condition

    You are welcome from ALL of us, BUT....Please, don't post Twice the same question...!!

    http://www.excelforum.com/excel-work...condition.html

+ 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