ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   switch statement (https://www.excelbanter.com/excel-discussion-misc-queries/35183-switch-statement.html)

tkaplan July 13th 05 07:55 PM

switch statement
 

is there a switch statement that i can use in a cell as a formula?

i have a value in col a.
in col e i want that if the value in a is 1, it should return the value
in col B, if it's 2, return col C if it's 3, return col D.

I know that i can do this with a nested if statement but i prefer
switch -

if someone can please tell me how to do this i would really appreciate
it.

Thank you.


--
tkaplan
------------------------------------------------------------------------
tkaplan's Profile: http://www.excelforum.com/member.php...o&userid=22987
View this thread: http://www.excelforum.com/showthread...hreadid=386912


JE McGimpsey July 13th 05 08:12 PM

One way:

E1: =CHOOSE(A1,B1,C1,D1)

In article ,
tkaplan wrote:

is there a switch statement that i can use in a cell as a formula?

i have a value in col a.
in col e i want that if the value in a is 1, it should return the value
in col B, if it's 2, return col C if it's 3, return col D.

I know that i can do this with a nested if statement but i prefer
switch -

if someone can please tell me how to do this i would really appreciate
it.

Thank you.



All times are GMT +1. The time now is 03:13 AM.

Powered by vBulletin® Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.
ExcelBanter.com