+ Reply to Thread
Results 1 to 7 of 7

Count even and odd numbers?

Hybrid View

  1. #1
    Registered User
    Join Date
    04-14-2007
    Location
    Phoenix AZ
    Posts
    32

    Count even and odd numbers?

    I'm trying to make a spread sheet that helps me select lottery numbers. I want to be able to count all the even/odd numbers in a column then return the total of each in a single column like this:

    "67E - 74O"

    This is a single condition of many to help me make a selection for my lottery numbers. Maybe an IF condition & divide by 2 with or without a remainder would work but I can't figure this one out.

    Tom

  2. #2
    Valued Forum Contributor
    Join Date
    07-11-2004
    Posts
    851
    adjust your range as required
    =SUMPRODUCT((MOD(A1:A10,2)=0)*1)&"E"&" "&SUMPRODUCT((MOD(A1:A10,2)<>0)*1)&"O"
    not a professional, just trying to assist.....

  3. #3
    Registered User
    Join Date
    04-14-2007
    Location
    Phoenix AZ
    Posts
    32
    Quote Originally Posted by duane
    adjust your range as required
    =SUMPRODUCT((MOD(A1:A10,2)=0)*1)&"E"&" "&SUMPRODUCT((MOD(A1:A10,2)<>0)*1)&"O"
    Thanks, I put it in my formula text and will install it later!

  4. #4
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,696
    ....but if you might have blanks in the range....

    =COUNT(A1:A100)-SUMPRODUCT(MOD(A1:A100,2))&"E - "&SUMPRODUCT(MOD(A1:A100,2))&"O"

  5. #5
    Registered User
    Join Date
    04-14-2007
    Location
    Phoenix AZ
    Posts
    32
    Quote Originally Posted by daddylonglegs
    ....but if you might have blanks in the range....

    =COUNT(A1:A100)-SUMPRODUCT(MOD(A1:A100,2))&"E - "&SUMPRODUCT(MOD(A1:A100,2))&"O"

    What I'ld like to do after giving it some thought is to have the odd numbers font color red, and the even numbers font color blue. I would like to have this condition right in the 5 columns that I enter the values for the lotto5 picks. I don't have any formulas bound to those columns, but I do call on the value of those cells with several other functions in different columns. I would also like to count the number of red font odd numbered items in each column and return that to a cell, and the same with the blue font even numbered items for each column. The reason for this if the total number of evens are lagging behind the odds(or visa-versa) but doesn't reflect that at the top of the column where I'll be looking for the latest odd/even probability. This will help make the call weather this columns next number will be even or odd. The odd/even check is very helpful for selecting numbers.

    Tom
    Last edited by farmerTom; 04-22-2007 at 12:35 PM.

  6. #6
    Registered User
    Join Date
    04-14-2007
    Location
    Phoenix AZ
    Posts
    32
    Quote Originally Posted by duane
    adjust your range as required
    =SUMPRODUCT((MOD(A1:A10,2)=0)*1)&"E"&" "&SUMPRODUCT((MOD(A1:A10,2)<>0)*1)&"O"

    Thanks Duane,

    That works perfectly! I'm using this formula
    =COUNT(B1:B163)-SUMPRODUCT((MOD(B1:B163,2)=0)*1)&"E"&" "&SUMPRODUCT((MOD(B1:B163,2)<>0)*1)&"O"
    to count the totals of each..... that's because I have 163 rows at present.

    Tom

    Checking this formula on smaller amount of cells it appears the Count pre-fix messes things up... The formula works as
    =SUMPRODUCT((MOD(B1:B163,2)=0)*1)&"E"&" "&SUMPRODUCT((MOD(B1:B163,2)<>0)*1)&"O"
    Just like you originally said!
    Last edited by farmerTom; 04-23-2007 at 11:10 PM.

  7. #7
    Registered User
    Join Date
    04-14-2007
    Location
    Phoenix AZ
    Posts
    32
    Why I asked......


    2E  4O	  2E  4O   1E  5O   2E  4O   3E  3O
     5E  5O	  4E  6O   3E  7O   4E  6O   7E  3O
    14E 16O	 15E 15O  15E 15O  12E 18O  17E 13O
    87E 76O	 77E 86O  75E 88O  84E 79O  74E 89O
    With this data I see Column 3 pretty much has to be an odd number. In Column 5 the long history shows even numbers are lagging, but the E/O in the short history are balanced????? Can this "deviance" be trapped in time or is thee a potentual for a "catch up" for the "E's" in the future?


    Col1 is probably an even, col2 is probably an even, col3 almost has to be an even, col4 is probably an even, and col5 I think will be an odd... slim chance of all 5 numbers being all even.
    Last edited by farmerTom; 04-23-2007 at 11:36 PM.

+ 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