+ Reply to Thread
Results 1 to 11 of 11

Counif calculation based on 2 criteria

Hybrid View

  1. #1
    Registered User
    Join Date
    08-25-2011
    Location
    UK
    MS-Off Ver
    Excel 2003
    Posts
    15

    Counif calculation based on 2 criteria

    Hi all,

    I have am setting up a spreadsheet which has 2 basic columns,
    Column A will be either "yes" or "no",
    Column B will then have 1 of 17 possible "defect" codes.

    I would like to "count" the number of specific instances in column "B", but only if Column A is equal to "yes".

    Iam aware of the basic "Countif(Column,"entry), but can and "and" statement be added to this?

    Many thanks for any help,

    Stu

  2. #2
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326

    Re: Counif calculation based on 2 criteria

    Hi and welcome to the board

    Have you tried a Pivot Table?

  3. #3
    Registered User
    Join Date
    08-25-2011
    Location
    UK
    MS-Off Ver
    Excel 2003
    Posts
    15

    Re: Counif calculation based on 2 criteria

    Hi,

    ..yes I am familiar with Pivot tables, but I am writting the spreadsheet for a collegaue who has "limited / no knowledge of oivot tables. I thought that a formulae is a bit more visible...

    Stu

  4. #4
    Registered User
    Join Date
    08-22-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2007
    Posts
    48

    Re: Counif calculation based on 2 criteria

    =COUNTIFS(Sheet1!$A$1:$A$50,"Yes",Sheet1!$B$1:$B$50,"Defect Code")

  5. #5
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326

    Re: Counif calculation based on 2 criteria

    Seems to me that a PT is much more intuitive than a formula, but then again...

  6. #6
    Registered User
    Join Date
    08-25-2011
    Location
    UK
    MS-Off Ver
    Excel 2003
    Posts
    15

    Re: Counif calculation based on 2 criteria

    Hi, and thanks for the formula...I have tried it (as follows..."=COUNTIFS('Data Input'!E1:E6000,"yes",'Data Input'!F1:F6000,A6)"...but I just get a "#Name?".......

    any other help gratefully appreciated..or am I doing something basic?

    Thanks again,

    Stu

  7. #7
    Registered User
    Join Date
    08-25-2011
    Location
    UK
    MS-Off Ver
    Excel 2003
    Posts
    15

    Re: Counif calculation based on 2 criteria

    NB ...sorry...I have left out the "S" at the end of "countif"...but I still get a formulae error message?

    Stu

  8. #8
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326

    Re: Counif calculation based on 2 criteria

    Try =sumproduct(--(Sheet1!$A$1:$A$50="Yes"),--(Sheet1!$B$1:$B$50="Defect Code"))

    (COUNTIFS is a XL 2007 function)

  9. #9
    Registered User
    Join Date
    08-25-2011
    Location
    UK
    MS-Off Ver
    Excel 2003
    Posts
    15

    Re: Counif calculation based on 2 criteria

    ..many thanks again for input, but I have tried this and still just get an error message?

    Stu

  10. #10
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326

    Re: Counif calculation based on 2 criteria

    To best describe or illustrate your problem you would be better off attaching a dummy workbook, the workbook should contain the same structure and some dummy data of the same type as the type you have in your real workbook - so, if a cell contains numbers & letters in this format abc-123 then that should be reflected in the dummy workbook.

    If needed supply a before and after sheet in the workbook so the person helping you can see what you are trying to achieve.

    Doing this will ensure you get the result you need!

  11. #11
    Registered User
    Join Date
    08-25-2011
    Location
    UK
    MS-Off Ver
    Excel 2003
    Posts
    15

    Re: Counif calculation based on 2 criteria

    OK, example spreadsheet enclosed...(NB Excell 2003...so I may not be able to do it)

    Thanks
    Attached Files Attached Files

+ 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