I have a column of numbers, some positive and some negative.

  • Thread starter Thread starter Skip
  • Start date Start date
S

Skip

I woiuld like to add three to each number so

EXAMPLE

4 becomes 7 in the next cell
and
-3 becomes -6 in the next cell
Any help appeciated. Thanks.
 
Note that with my previous suggestion, zero will stay as zero.

Your example shows that you want to add three to positive numbers, and subtract three from negative numbers; but you do not define what you want to do with zero.

I would like zero to become 3.
Thnaks for the help.
 
"Skip" <[email protected]> ha scritto nel messaggio
Note that with my previous suggestion, zero will stay as zero.

Your example shows that you want to add three to positive numbers, and
subtract three from negative numbers; but you do not define what you want
to do with zero.

I would like zero to become 3.
Thnaks for the help.


****************

=(ABS(A1)+3)*IF(A1<0,-1,1)

bye, E.
 
Or maybe more simply...
=A1+IF(A1<0,-3,3)

Not sure if this would qualify as simpler, but it does eliminate all
function calls...

=A1+3-6*(A1<0)

Rick Rothstein (MVP - Excel)
 
Rick Rothstein said:
Not sure if this would qualify as simpler, but it does eliminate all
function calls...

=A1+3-6*(A1<0)

At the cost of additional add and multiply operations and a type
conversion (boolean to double). Unlikely this would be much faster.
 
Back
Top