Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 34
Default avoid embedded if statements

Hello,

Is there a quick way to do multiple if statements rather than using an
embedded if statement?

I have the following:

If A1 = 1 then write carpet, If A1 = 2 then write couch, If A1 = 3 then
write table and so on.

Is there an easier way?

Ellen


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,389
Default avoid embedded if statements

The easier way is to use a lookup, the most common being the Vlookup
function.

Regards,
Fred

"ellebelle" wrote in message
...
Hello,

Is there a quick way to do multiple if statements rather than using an
embedded if statement?

I have the following:

If A1 = 1 then write carpet, If A1 = 2 then write couch, If A1 = 3 then
write table and so on.

Is there an easier way?

Ellen



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,651
Default avoid embedded if statements

On Wed, 30 Jan 2008 04:56:00 -0800, ellebelle
wrote:

Hello,

Is there a quick way to do multiple if statements rather than using an
embedded if statement?

I have the following:

If A1 = 1 then write carpet, If A1 = 2 then write couch, If A1 = 3 then
write table and so on.

Is there an easier way?

Ellen


=choose(a1,"carpet","couch","table")

or

=INDEX(E1:E3,A1)

Where
E1: carpet
E2: couch
E3: table

If your A1 values are not sequential, you could use VLOOKUP


--ron
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,856
Default avoid embedded if statements

If you have several items, then you could do it this way:

=CHOOSE(A1,"carpet","couch","table","and so on")

The drawback is that you have to amend the formula if you want to add/
delete/amend items.

Alternatively, you could set up a table somewhere like this (eg in
X1:Y3):

1 carpet
2 couch
3 table

and then use:

=VLOOKUP(A1,X1:Y10,2,0)

Here you can add items to the table without amending the formula
(although the range will have to cover the the extent of the table).

Hope this helps.

Pete


On Jan 30, 12:56*pm, ellebelle
wrote:
Hello,

Is there a quick way to do multiple if statements rather than using an
embedded if statement?

I have the following:

If A1 = 1 then write carpet, If A1 = 2 then write couch, If A1 = 3 then
write table and so on.

Is there an easier way?

Ellen


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I avoid getting this: © in spreadsheet when I want this (c Chris Excel Discussion (Misc queries) 7 March 23rd 07 07:45 PM
IF Statements (Mutliple Statements) Deezel Excel Worksheet Functions 3 October 19th 06 06:13 AM
How to avoid #DIV/0 from appearing Chris921 Excel Discussion (Misc queries) 1 March 1st 06 05:12 PM
reducing the number of times an IF statement needs to be calculated in embedded IF statements Harold Good Excel Discussion (Misc queries) 4 November 17th 05 06:36 PM
what is this, how do I avoid it? datadude1959 Excel Discussion (Misc queries) 2 September 29th 05 06:05 PM


All times are GMT +1. The time now is 11:45 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"