+ Reply to Thread
Results 1 to 7 of 7

COUNTIF (A1:A10=8) but only if the cell next to it is "X"

  1. #1
    Registered User
    Join Date
    02-20-2007
    Posts
    13

    COUNTIF (A1:A10=8) but only if the cell next to it is "X"

    I need to report on all the jobs closed in a period but need to separate them into 2 categories.

    So in COL (A) I have the period the job was closed and in COL (B) I have the category of the job.

    I need a formula that then says something like this;

    =COUNTIF (COL_A=8 AND IF the cell next to it COL_B has a value of “CategoryA” then count it)

    If only it were as easy as that lol

    Thanks for your time and help guys.

  2. #2
    Valued Forum Contributor Richard Schollar's Avatar
    Join Date
    05-23-2006
    Location
    Hampshire UK
    MS-Off Ver
    Excel 2002
    Posts
    1,264
    Hi

    =SUMPRODUCT(--(A1:A100=8),--(B1:B100="CategoryA"))

    Note that you can't use whole column references in Sumproduct (unless on xl2007) - so no A:A or B:B referencing.

    For maximum flexibility, you should place the criteria (ie 8 and CategoryA) in separate cells, and reference those cells in the formula.

    Richard

  3. #3
    Registered User
    Join Date
    02-20-2007
    Posts
    13
    Many thanks for your help richard, works perfectly!

    Would the same kind of formula work if say i wanted to sum all the figures for closure times?

    Each job has a closure time and i need to get an average for each period!

    thanks for help you have saved me a big headache!

    -Edit-

    ok i gave it ago but didnt work, heres how i did it (don't laugh)

    =SUMPRODUCT(--(SUM('veg 06-07'!$N$3:$N$5000))/(COUNTIF('veg 06-07'!$M$3:$M$5000,"=8"))--($Q$3:$Q$5000="Inner"))
    Last edited by juzsp; 11-14-2007 at 08:28 AM.

  4. #4
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675
    Can you explain what you want to do?

    It looks like you want to Average column N when two other conditions are met, Column Q = "Inner" and column M??

  5. #5
    Registered User
    Join Date
    02-20-2007
    Posts
    13
    daddylonglegs, you hit the nail on the head. Sorry about my way of explaining things.

    Yes, i need to average all the closure times (N) of jobs in the ("Inner" area of london (Q)) that fall in (period "8" (M))
    Last edited by juzsp; 11-14-2007 at 08:32 AM.

  6. #6
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Please Login or Register  to view this content.
    or

    Please Login or Register  to view this content.
    the last formula must be confirmed with CTRL+SHIFT+ENTER not just ENTER for it to work...you will see { } brackets appear around the formula.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  7. #7
    Registered User
    Join Date
    02-20-2007
    Posts
    13
    Thank you SO SO Much! That worked perfectly!

+ 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