+ Reply to Thread
Results 1 to 4 of 4

Counting even if no number is present

  1. #1
    Forum Contributor
    Join Date
    11-13-2010
    Location
    Warren, Michigan
    MS-Off Ver
    Excel 2008 for Mac
    Posts
    307

    Counting even if no number is present

    As you will notice on attached sample.

    I looking to count the total "ODD" and "EVEN" numbers using:

    =SUMPRODUCT(--(MOD(A2:F2,2)=1)) for ODD
    =SUMPRODUCT(--(MOD(A2:F2,2)=0)) for EVEN

    The problem is when a cell is blank the coding counts the blank cell as a EVEN number.

    Any suggestions on how to change the coding to not count "blank cells"??
    Attached Files Attached Files
    Last edited by khank; 04-08-2011 at 10:27 AM.

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

    Re: Counting even if no number is present

    In the EVEN column:

    =SUMPRODUCT(--(MOD(A2:F2,2)=0))-COUNTIF(A2:F2,"")

  3. #3
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Counting even if no number is present

    Or this for the evens:

    =SUMPRODUCT((MOD(B2:F2,2)=0)*(B2:F2<>""))
    Last edited by Cutter; 04-08-2011 at 10:17 AM.

  4. #4
    Forum Contributor
    Join Date
    11-13-2010
    Location
    Warren, Michigan
    MS-Off Ver
    Excel 2008 for Mac
    Posts
    307

    Re: Counting even if no number is present

    Coding works on both submittals - thanks

+ 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