user25765
user25765

Reputation: 43

Copying specific values to a separate column

I have an excel sheet with 6 columns A,B,C,D,E,F,G

The sheet gives an overview of states and cities.

My problem is that column C (region) contains names of states and cities. Every time the name of a state is displayed, cities will follow beneath in this same column. Column E contains values state or city. If column C has value name of a state E has value state, if it has a name of a city E has value city

What I want is every city followed by a separate column:Statename. I am looking for a function when E has value state the value in C 'Name of the state will be copied to a separate column Statename behind each cityname

Cities and states

Upvotes: 2

Views: 69

Answers (1)

ferc
ferc

Reputation: 558

Something like this, perhaps?

IF(B2="state", "", IF(B1="state",A1,C1))

enter image description here

Upvotes: 1

Related Questions