+ Reply to Thread
Results 1 to 4 of 4

Even and Odd Numbers

  1. #1
    Andrew
    Guest

    Even and Odd Numbers

    Hi

    I need a formula that will Add 2 to the numbers in Column A if they are even
    and Minus Two if they are Odd.

    Thanks in advance

  2. #2
    Forum Contributor
    Join Date
    06-10-2004
    Location
    India
    Posts
    1,066
    Use:

    =A1+IF(MOD(A1,2)=0,2,-2)

    Mangesh

  3. #3
    KL
    Guest

    Re: Even and Odd Numbers

    Try these:

    =A1+2-4*MOD(A1,2)
    =A1+2*-1^MOD(A1,2)
    =A1+IF(MOD(A1,2),-2,2)
    =A1+CHOOSE(1+MOD(A1,2),2,-2)

    Regards,
    KL


    "Andrew" <[email protected]> wrote in message
    news:[email protected]...
    > Hi
    >
    > I need a formula that will Add 2 to the numbers in Column A if they are
    > even
    > and Minus Two if they are Odd.
    >
    > Thanks in advance




  4. #4
    Bernard Liengme
    Guest

    Re: Even and Odd Numbers

    Try this =A1+ISEVEN(A1)*2-ISODD(A1)*2
    best wishes
    --
    Bernard V Liengme
    www.stfx.ca/people/bliengme
    remove caps from email

    "Andrew" <[email protected]> wrote in message
    news:[email protected]...
    > Hi
    >
    > I need a formula that will Add 2 to the numbers in Column A if they are
    > even
    > and Minus Two if they are Odd.
    >
    > Thanks in advance




+ 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