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

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.
 
S

Skip

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.
 
P

plinius

"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.
 
R

Rick Rothstein

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)
 
H

Harlan Grove

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top