Ask a Question Sign up for Free 77 Experts currently online. Ask Questions for Free!

sort by even or odd - Microsoft Excel

Can someone tell me how to sort a column by if a number is odd or even. I would guess that I would need to use a function in another column and first designate if the number is even or odd. Can someone please tell me what function this is ...

Results 1 to 11 of 11

  1. #1

    sort by even or odd

    Can someone tell me how to sort a column by if a number
    is odd or even. I would guess that I would need to use a
    function in another column and first designate if the
    number is even or odd. Can someone please tell me what
    function this is or how to do this? Thanks in advance.
    Holstein
  2. #2

    sort by even or odd

    Hi

    Look at the function ISODD

    For eg if list is in column A put the following formula in
    column b and drag down.

    =isodd(a1)

    And then sort by column B

    Hope this helps

     
    Edgar
  3. #3

    Re: sort by even or odd

    Hi
    one way: add the following function in the adjacent column:
    =IF(MOD(A1,2)=1,"Odd","Even")
    copy down and sort with this column

    --
    Regards
    Frank Kabel
    Frankfurt, Germany

    Holstein wrote: 
    Frank
  4. #4

    Re: sort by even or odd

    Thank you both for your help. It works great. Thank you
    again for your help. I appreciate it very much. 
    column: 

  5. #5

    Re: sort by even or odd

    Frank
    Can you tell me what this function is doing. I understand
    that the A1 is the column with the number. What does MOD
    do and what is the 2 and the =1? It works great but I'm
    trying to learn as much as I can. Thanks again. 
    column: 

  6. #6

    Re: sort by even or odd

    Hi
    Mod returns the rest of a division. So in your case the cell A1 is
    divided by two and the rest of this division is returned. e.g.
    MOD(4,2) = 0
    MOD(5,2) = 1

    --
    Regards
    Frank Kabel
    Frankfurt, Germany

    microsoft.com wrote: 

    Frank
  7. #7

    Re: sort by even or odd

    Holstein

    If you check the ysis Toolpak in Tools>Add-ins you can use either the
    ISODD or ISEVEN function to return TRUE or FALSE in an adjacent column.

    Sort or Filter on this column.

    Assume column of numbers is A.

    In B1 enter =ISODD(A1) and drag/copy down or double-click on B1 to copy down.

    Gord Dibben Excel MVP



    On Wed, 25 Feb 2004 09:03:18 -0800, "Holstein"
    <microsoft.com> wrote:
     

    Gord
  8. #8

    Re: sort by even or odd

    =MOD({cell-of-interest},2)=0 will give TRUE for even and FALSE for odd.

    --
    Regards,

    Tushar Mehta
    www.tushar-mehta.com
    Excel, PowerPoint, and VBA add-ins, tutorials
    Custom MS Office productivity solutions

    In article <167d01c3fbc1$442a0410$gbl>,
    microsoft.com says... 
    Tushar
  9. #9

    Re: sort by even or odd

    Hi Tushar!

    =MOD(INT(MyCell),2)=0
    tes the ysis Toolpak ISEVEN treatment of non integers.

    But I'm inclined to prefer a FALSE response for numbers that are not exact
    integers.

    --
    --
    Regards
    Norman Harker MVP (Excel)
    Sydney, Australia
    Excel and Word Function Lists (Classifications, Syntax and Arguments)
    available free to good homes.

    com.au
    Excel and Word Function Lists (Classifications, Syntax and Arguments)
    available free to good homes.
    "Tushar Mehta" <SeeOhEm> wrote in message
    news:.. 


    Norman
  10. #10

    Re: sort by even or odd

    Hi Norman,

    After a while, one either forgets or just gets sloppy. My intuitive
    reaction to odd/even is to test for divisibility by 2. Though,
    strictly speaking, it applies only to whole numbers, doesn't it?

    The ATP is amazing. The more I learn about it the more I appreciate my
    decision to minimize my reliance on it.

    In any case, if one wanted to duplicate the ISEVEN functionality one
    should TRUNC rather than INT. There's a difference when dealing with
    negative numbers.

    So, I guess a strict test for even would be
    =IF(INT(X)<>X,NA(),MOD(X,2)=0)

    --
    Regards,

    Tushar Mehta
    www.tushar-mehta.com
    Excel, PowerPoint, and VBA add-ins, tutorials
    Custom MS Office productivity solutions

    In article <e1t19sA$phx.gbl>,
    com.au says... 
    Tushar
  11. #11

    Re: sort by even or odd

    Hi Tushar!

    Agreed on your revised version.

    Also agreed on the minimization of reliance on ysis ToolPak.

    I'm not sure how mathematicians view it, but there is a possibility
    that 1.1 should return FALSE rather than #NA!

    Those ATP functions are due for a 10000 mile service.

    --
    Regards
    Norman Harker MVP (Excel)
    Sydney, Australia
    com.au
    Excel and Word Function Lists (Classifications, Syntax and Arguments)
    available free to good homes.
    "Tushar Mehta" <SeeOhEm> wrote in
    message news:.. 
    my 
    with 
    not exact 


    Norman

Similar Threads

  1. Sort date by day and not year
    By Kathy in forum Microsoft Excel
    Replies: 2
    Last Post: 02-17, 07:59 PM
  2. Sort Discussions
    By sgolemon in forum Microsoft SharePoint Workspace
    Replies: 2
    Last Post: 12-16, 09:18 PM
  3. Address Book sort
    By George in forum Microsoft Office 2010 / 2007 / 2003
    Replies: 2
    Last Post: 07-02, 10:39 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100