Home |
Search |
Today's Posts |
#1
|
|||
|
|||
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
|
|||
|
|||
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" wrote in message ... 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 |
#3
|
|||
|
|||
Use: =A1+IF(MOD(A1,2)=0,2,-2) Mangesh -- mangesh_yadav ------------------------------------------------------------------------ mangesh_yadav's Profile: http://www.excelforum.com/member.php...o&userid=10470 View this thread: http://www.excelforum.com/showthread...hreadid=375173 |
#4
|
|||
|
|||
Try this =A1+ISEVEN(A1)*2-ISODD(A1)*2
best wishes -- Bernard V Liengme www.stfx.ca/people/bliengme remove caps from email "Andrew" wrote in message ... 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 |
Thread Tools | Search this Thread |
Display Modes | |
|
|