# Microsoft Office Application Help - Excel Help forum > Excel Formulas & Functions >  >  IF cell is empty, copy data from another cell on that row

## thundercat77

I'm new here, so looking forward to learning and helping where I can!

I have a strange thing I need done that I could not find here (i did search) or on google... I think it's because I really don't know the best way to explain, therefore search...

in it's simplest form, let's say I have a sheet with 3 columns. the first is the physical address, second is for P.O. box and third is where I need the formula and final address...

ok, so what I need to do is have the third column show the contents of the P.O. box for it's row IF there is one. IF NOT it needs to show the contents of the physical address field of that row. I can't figure out how to check for an empty field and then how would I copy the data in another cell on that same row based on the results?

ANY and all help is GREATLY appreciated. This is way beyond me and I'm hoping someone here has done something like this before?

- Rich

----------


## jasoncw

Assuming A2 has physical address and B2 has PO Box, place this formula in cell C2 and copy down:

=IF(B2="",A2,B2)

This will give you EITHER the PO Box OR the physical address.  If you want the final address to have both, then simply:

=A2&IF(B2="",""," "&B2)

This will put a space between the two.

----------


## thundercat77

perfect. almost too simple... i'm a php coder first, so I already had the IF, ELSE statement embedded.  haha

THANKS!

----------

