Copy from one named cell to another dependent on content of a third.

C

Colin Hayes

HI

I have a small puzzle.

In Column H I have a row of numbers. All ones and threes , with some
blanks.

If the number in H1 is a 1 , then the content of B1 should be copied
into K1.

This would apply to all cells in H which contain a 1. All other numbers
would be ignored.

Can this be done?

Grateful for any assistance.
 
R

Ron@Buy

If only numbers appear in column H try =IF(B1=1,H1,0) in cell K1 then copy down
This will cause a zero to appear in column K where number in column B is not 1
If you do not want a zero to show go to TOOLS, OPTIONS, VIEW and untick Zero
values.
Alternatively if you are entering letters or other symbols in column H you
could try =IF(B1=1,H1,"") in cell K1 and copy down. Hope this helps.
 
C

Colin Hayes

Ron@Buy said:
If only numbers appear in column H try =IF(B1=1,H1,0) in cell K1 then copy down
This will cause a zero to appear in column K where number in column B is not 1
If you do not want a zero to show go to TOOLS, OPTIONS, VIEW and untick Zero
values.
Alternatively if you are entering letters or other symbols in column H you
could try =IF(B1=1,H1,"") in cell K1 and copy down. Hope this helps.
Hi Ron

OK thanks for that - very helpful

I was wondering if this could be extended to include the existing
content of K1 , rather than over write it.

So , that in L1 we could have code which would say that

If H1 is 1 , then the content of B1 should be copied into L1

but

If H1 is 3 , then the content of K1 should be copied into L1.


Is this possible?

Thanks again.
 

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