# Thread: Making a What If Statement for Adding Text to a cell

1. ## Making a What If Statement for Adding Text to a cell

I have a worksheet I have that I need to extract the country from cell B2 abd insert in Cell B1. I want the original data to remain, so I am not talking about replacement.

Here is an example.
A=Country

I need to input a formula in cell A2, to search in cell B2 for the country in the address line and input the value(name of country) in column A.

I need the formula to look through a list of say 60 names for the name in column B.

 Country Full Address 5th Avenue, New Zealand Raby Castle, Durham, England Veiros, Aveiro, Portugal Barcellanos, Braga, Poland Durham, Bonsai, Brazil Castleburry, Herdfordshire, Italy Kinnersly, Balmand, Canada La Mote Kent, Peru Champagne, Cards, Australia

2. Try:

=LOOKUP(10^10,SEARCH(Countries!\$A\$2:\$A\$53,B2),Countries!\$A\$2:\$A\$53)

copied down

3. Originally Posted by NBVC
Try:

=LOOKUP(10^10,SEARCH(Countries!\$A\$2:\$A\$53,B2),Countries!\$A\$2:\$A\$53)

copied down

That worked great, thank you, this will save me hours or days of time,

have a great day,

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•