Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Andrew
 
Posts: n/a
Default 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   Report Post  
KL
 
Posts: n/a
Default

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   Report Post  
mangesh_yadav
 
Posts: n/a
Default


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   Report Post  
Bernard Liengme
 
Posts: n/a
Default

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 12:47 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"