Conditional IF statements

  • Thread starter Thread starter sike11 via OfficeKB.com
  • Start date Start date
S

sike11 via OfficeKB.com

Hi All,

Please help!!

My problem is the following:

I have text in a column like this

A1
BTEC National Diploma
AS Economics
GCSE Maths

What I would like to happen in the next column is a formula like the
following:

IF A1 = "BTEC National" then A2 = 1
ELSE
IF A1 = "AS" then A2 = 2
ELSE
IF A1 = "GCSE" then A2 = 3

I am a little stumped as to how achieve this. Any ideas?

Thank you in advance!

Mary.
 
Hi Mary,

Try this one. Write this formula at cell A2


=IF(A1="BTEC National",1,IF(A1="AS",2,IF(A1="GCSE",3,"")))


Hope that helps.

Thankyou,
Shail
 
Hi Mary,
It does work. Enter the formula into cell A2. A2 will then be blank. Now
enter BTEC into A1 and A2 will return 1. Similarly in A1, AS returns 2 and
GCSE returns 3 in A2.
Regards,
Alan.
sike11 via OfficeKB.com said:
Hi,

Thanks for the suggestion. However, it did not work as A2 was blank. Any
other ideas?
In A2,
=IF(A1="BTEC",1,IF(A1="AS",2,IF(A1="GCSE",3,"")))
Regards,
Alan.
[quoted text clipped - 23 lines]
 
Hi Alan,

I have managed to resolve it!! You did point me in the right direction. Thank
you.

Mary.
Hi Mary,
It does work. Enter the formula into cell A2. A2 will then be blank. Now
enter BTEC into A1 and A2 will return 1. Similarly in A1, AS returns 2 and
GCSE returns 3 in A2.
Regards,
Alan.
[quoted text clipped - 10 lines]
 
It's heart-warming to hear that you managed to resolve it all by yourself.
I'm humbly glad to have pointed you in the right direction.
Regards,
Alan.
sike11 via OfficeKB.com said:
Hi Alan,

I have managed to resolve it!! You did point me in the right direction.
Thank
you.

Mary.
Hi Mary,
It does work. Enter the formula into cell A2. A2 will then be blank. Now
enter BTEC into A1 and A2 will return 1. Similarly in A1, AS returns 2 and
GCSE returns 3 in A2.
Regards,
Alan.
[quoted text clipped - 10 lines]
 
Why?
VLOOKUP is great for looking up a few dozen or hundreds of items data, but
why create a vlookup table for three possible results? The IF statement does
it just as well and it's self contained without the need for data elsewhere.
Regards,
Alan.
 

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

Back
Top