+ Reply to Thread
Results 1 to 7 of 7

Count number of cells in column with a value of 0 (Zero) based on value in another column

  1. #1
    Registered User
    Join Date
    11-17-2012
    Location
    Dublin
    MS-Off Ver
    Excel 2003/2007
    Posts
    6

    Count number of cells in column with a value of 0 (Zero) based on value in another column

    I want to count the number of cells in column (AF) with a value of 0 (Zero) based on a specific value being in column (AC) ....."A", "Px" or"P"

    Using Excel 2003 Have tried Countif, Dcount & other possibilities without success. HELP !!!!!!!!!!
    Last edited by Ryanaj; 11-18-2012 at 09:12 AM.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Count number of cells in column with a value of 0 (Zero) based on value in another col

    In Excel 2007+ it's easy with SUMIFS or COUNTIFS (that's not the same as SUMIF or COUNTIF). But in Excel 2003 you're stuck with SUMPRODUCT to do this counting, and you can't reference whole columns.

    So, setting a specific number of rows to check:

    =SUMPRODUCT(--($AF$1:$AF$100=0), --($AC$1:$AC$100="A"))
    =SUMPRODUCT(--($AF$1:$AF$100=0), --($AC$1:$AC$100="Px"))
    =SUMPRODUCT(--($AF$1:$AF$100=0), --($AC$1:$AC$100="P"))
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Count number of cells in column with a value of 0 (Zero) based on value in another col

    Hi,

    Since you don't have Excel 2007 or later which has the more powerful COUNTIFS() - plural function you'll need to use the usual workaround of

    =SUMPRODUCT((AF1:AF100=0)*(AC1:AC100="A"))

    obviously changing the range and "A" as appropriate
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  4. #4
    Registered User
    Join Date
    11-17-2012
    Location
    Dublin
    MS-Off Ver
    Excel 2003/2007
    Posts
    6

    Re: Count number of cells in column with a value of 0 (Zero) based on value in another col

    Great, I beter ask the obvious question ... Excell 2007 solution for the origional Thread ie countifs for AF =A, AC =0

  5. #5
    Forum Expert dredwolf's Avatar
    Join Date
    10-27-2012
    Location
    Clearwater,Canada
    MS-Off Ver
    Excel 2007
    Posts
    2,649

    Re: Count number of cells in column with a value of 0 (Zero) based on value in another col

    Try
    =COUNTIFS(AF:AF,"=0",AC:AC,"=A")

    Hope this helps
    A picture may be worth a thousand words, BUT, a sample Workbook is worth a thousand screenshots!
    -Add a File - click advanced (next to quick post), scroll to manage attachments, click, select add files, click select files, select file, click upload, when file shows up at bottom left, click done (bottom right), click submit
    -To mark thread Solved- go top of thread,click Thread Tools,click Mark as Solved
    If you received helpful response, please remember to hit the * of that post

  6. #6
    Registered User
    Join Date
    11-17-2012
    Location
    Dublin
    MS-Off Ver
    Excel 2003/2007
    Posts
    6

    Re: Count number of cells in column with a value of 0 (Zero) based on value in another col

    Perfect - Thank You

  7. #7
    Forum Expert dredwolf's Avatar
    Join Date
    10-27-2012
    Location
    Clearwater,Canada
    MS-Off Ver
    Excel 2007
    Posts
    2,649

    Re: Count number of cells in column with a value of 0 (Zero) based on value in another col

    You are welcome

+ 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