IF Statements

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I hope someone can help??

I Column A i have varous names with a pre fix in brackets :-

Whitley Bay (BO)
Monkseaton (G)
Newcastle (D)

Each of the () represents something else ie (BO) = 3 (G) = 900 (D) = 1800

Is there a formula to pick out the () within each cell to produce what it
means in column B?

Any help will be appreciated
 
This might work for you:
=if(right(A1,4)="(BO)",3,if(right(A1,3)="(G)",900,
if(right(A1,3)="(D)",1800,0)))
 
I would create a table in another worksheet (sheet2??)

And put the strings in column A and the values in column B.

BO 3
g 900
d 1800

Then use a formula to extract the stuff between the ()'s.

If the data is in A1:
=VLOOKUP(MID(A1,FIND("(",A1)+1,FIND(")",A1)-FIND("(",A1)-1),Sheet2!A:B,2,FALSE)

This'll work as long as the ()'s only show up once.

And if you're not familiar with =vlookup(), Debra Dalgleish has nice
instructions at:
http://www.contextures.com/xlFunctions02.html
 
Thats great, Thanks Guys

Dave Peterson said:
I would create a table in another worksheet (sheet2??)

And put the strings in column A and the values in column B.

BO 3
g 900
d 1800

Then use a formula to extract the stuff between the ()'s.

If the data is in A1:
=VLOOKUP(MID(A1,FIND("(",A1)+1,FIND(")",A1)-FIND("(",A1)-1),Sheet2!A:B,2,FALSE)

This'll work as long as the ()'s only show up once.

And if you're not familiar with =vlookup(), Debra Dalgleish has nice
instructions at:
http://www.contextures.com/xlFunctions02.html
 

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

Similar Threads

Sum Total 2
Formula with multiple variables 8
Excel Countifs/Sumproduct with mutil Or statement 3
Code only works in Debug mode. Why? 6
If statement 2
"IF" Formula 3
IF/OR/AND function in a formula 5
possible COUNTIF? 4

Back
Top