+ Reply to Thread
Results 1 to 4 of 4

Count the number of odd numbers in a row

  1. #1
    Registered User
    Join Date
    02-12-2012
    Location
    White Mountains, NH
    MS-Off Ver
    Excel 2007
    Posts
    65

    Count the number of odd numbers in a row

    Hi,
    I could use an assist with a formula that would do the following:

    I have a row of values A1:U1 and would like to count the number of odd (or even) values in the row.

    The value zero would be considered 'even'.

    thank you,
    Chubs

  2. #2
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,885

    Re: Count the number of odd numbers in a row

    Hi Chubster,

    This should do the trick. To count the number of ODD values, use:

    =SUMPRODUCT(--(MOD(A1:U1,2)=1))

    For even, replace the last 1 with a 0.

    =SUMPRODUCT(--(MOD(A1:U1,2)=0))

    Hope that helps!

  3. #3
    Forum Contributor
    Join Date
    11-02-2011
    Location
    Rugby, England
    MS-Off Ver
    Office 365
    Posts
    869

    Re: Count the number of odd numbers in a row

    Hi,

    Please check the attached and see how that works for you
    galvinpaddy

    EDIT - Apologies Paul, must have submitted seconds after you
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    02-12-2012
    Location
    White Mountains, NH
    MS-Off Ver
    Excel 2007
    Posts
    65

    Re: Count the number of odd numbers in a row

    Paul,
    Worked perfectly.
    Thank you for the very quick and accurate response!

    Rgds,
    Chubs

+ 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