Help need with IF statement!!

T

TBFA

I need to combine these small if statements into one long if statemen
can anyone please help?

=IF(A17=(1,"Arsenal")
=IF(A17=(2,"Aston Villa")
=IF(A17=(3,"Birmingham City")
=IF(A17=(4,"Blackburn Rovers")
=IF(A17=(5,"Bolton Wanderers")
=IF(A17=(6,"Charlton Athletic")
=IF(A17=(7,"Chelsea")
=IF(A17=(8,"Everton")
=IF(A17=(9,"Fulham")
=IF(A17=(10,"Leeds United")
=IF(A17=(11,"Leicester City")
=IF(A17=(12,"Liverpool")
=IF(A17=(13,"Manchester City")
=IF(A17=(14,"Manchester United")
=IF(A17=(15,"Middlesbrough")
=IF(A17=(16,"Newcastle United")
=IF(A17=(17,"Portsmouth")
=IF(A17=(18,"Southampton")
=IF(A17=(19,"Tottenham Hotspur")
=IF(A17=(20,"Wolverhampton Wanderers")

Thanks a lot!
 
D

Dave R.

well, you can use CHOOSE;

CHOOSE(A17,"Aresenal","Aston Villa")

et. cetera; so if A17 has 1, it will be "Arsenal", and so on. If A17 is 200,
it will give an error statement since you don't have 200 things to choose
from.
 
C

Charles Maxson

Try the Choose function:

=CHOOSE(A17,"Arsenal","Aston Villa","Birmingham City","Blackburn
Rovers","Bolton Wanderers","Charlton
Athletic","Chelsea","Everton","Fulham","Leeds United","Leicester
City","Liverpool","Manchester City","Manchester
United","Middlesbrough","Newcastle
United","Portsmouth","Southampton","Tottenham Hotspur","Wolverhampton
Wanderers")

.... and go Liverpool!
 
T

TBFA

thanks very much for the feedback!!

Charles your idea work perfectly thankyou so much!
thanks also dave even though it's not quite what i wanted.
 
D

Dave R.

You're welcome, though mine and Charles' responses are the same, except I
wasn't going to put ALL those football teams in there as Charles so nicely
did-- I only put 2 of them, and explained when it would fail. From this,
some people would see the pattern and understand what choose does and feel
good about applying something they've learned. Others just want the answer.
No problem.
 
K

Ken Wright

LOL - I was wondering just how they differed????? - Figured it was my eyesight
:)

--
Regards
Ken....................... Microsoft MVP - Excel
Sys Spec - Win XP Pro / XL 00/02/03

----------------------------------------------------------------------------
It's easier to beg forgiveness than ask permission :)
----------------------------------------------------------------------------



Dave R. said:
You're welcome, though mine and Charles' responses are the same, except I
wasn't going to put ALL those football teams in there as Charles so nicely
did-- I only put 2 of them, and explained when it would fail. From this,
some people would see the pattern and understand what choose does and feel
good about applying something they've learned. Others just want the answer.
No problem.
 

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

Unique draws "Football" 6
Unique counting 18
IF statement 10
Use of arrays and loops 3

Top