in formulas how can I use contents of a cell?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need a formula to say:
if G2=10 keep contents of I2 in I2
BUT
if G2=11 move the contents of I2 to J2
BUT
if G2=12 move contents of I2 to K2

Can anyone help, please?
 
You can't do it the way you want. A function can only return a result to the
cell it is in. For instance, in J2 you could say

=IF(G2=11,I2,"")

but the value would still be in I2 as well.

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)
 
Is there a way to move the contents rather than just copy them? I don't mind
doing the formula per column.

So:

[putting formula in J2] if G2=11 move the contents of I2 to J2
 
No, not with a formula, as I said, a function can only return a result to
the cell it is in, it cannot change any other aspect of the worksheet, be
that values in other cells, or colours in other cells, etc.

You could do it with VBA.

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

Soo said:
Is there a way to move the contents rather than just copy them? I don't mind
doing the formula per column.

So:

[putting formula in J2] if G2=11 move the contents of I2 to J2



Bob Phillips said:
You can't do it the way you want. A function can only return a result to the
cell it is in. For instance, in J2 you could say

=IF(G2=11,I2,"")

but the value would still be in I2 as well.

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)
 
Back
Top