Automatically add a value in a column

O

Obonden

I have several big sheets and wants to add automatically a value to the cell
if the neighbourcell has a value.

Example:

A B C D
1 Ohio Mike 78 Man
2 Mona 34 Woman
3 John 43 Man
4 Linn
5 Lisa 44
6
7

This table should automatically - without knowing how many rows that
contains information - be like this:

A B C D
1 Ohio Mike 78 Man
2 Ohio Mona 34 Woman
3 Ohio John 43 Man
4 Ohio Linn
5 Ohio Lisa 44
6
7

Kjell
 
M

muddan madhu

use helping column E

in cell E2 put this formula

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

Obonden

Thanks, but that solution means I have to copy that formula to all cells
down to the last row containing data? How do I copy this formula without
knowing/seeing the data - I want to put this "auto-fill-in-routine" in a
macro. My problem is how to fill (a known) text into column A all the way
down to the last row without knowing how many rows there are in the sheet.

Kjell

"muddan madhu" <[email protected]> skrev i melding
use helping column E

in cell E2 put this formula

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

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