+ Reply to Thread
Results 1 to 4 of 4

Odd and Even Numbers

  1. #1
    Registered User
    Join Date
    01-06-2007
    Posts
    8

    Odd and Even Numbers

    Hi Everybody!

    I'm halfway through a little project and have come to a halt...

    The problem is:

    I have a row containing 7 numbers below 50. (ie, 01, 09, 22, 28, 30, 34, 48)

    In the cell to the right of these i want to use a 'COUNTIF' type function which will tell me how many of the previous 7 numbers are odd or even - is this possible in Excel?!

    EG. In this example, if I wanted to know how many of the 7 numbers were odd numbers, I would expect the cell to read '2'.

    Hope I've explained this easy-enough... any help would be excellent!

    Thanks. Carl

  2. #2
    Registered User
    Join Date
    07-28-2005
    Posts
    73
    If A contains the numbers(A2:A6) then I would use column B with formula =isodd(a2) and copy formula till A6, then in column c, countif("A2:A6",TRUE)

  3. #3
    Registered User
    Join Date
    01-06-2007
    Posts
    8
    Cheers mate,

    I had tried something along those lines, achieving nothing but NAME# error... and then found I hadn't got the Analysis Toolpak installed!

    I've got it now, and works perfectly... thanks!



  4. #4
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,723
    You can do this with a single formula (not requiring Analysis ToolPak). If you have 7 integers in the range B1:B7 this will count how many of them are odd

    =SUMPRODUCT(--(MOD(B1:B7,2)=1))

+ 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