# How can I do multiple IF's?

#### beenay

##### New Member
I have set up a spreadsheet with 8 radio buttons. Depending on which button is clicked, a number (1 through 8) is returned in a specific cell. If button 1 is pressed, I need another cell to return a "0" (zero). If 2 is pressed, I also need a "0". If 3 is pressed I need a "5". If 4, I need a "10". Etc. Etc. Etc. How can I use multiple IF statements in a formula for one cell?
This message was edited by beenay on 2002-10-10 14:02

### Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.

#### royUK

##### Well-known Member
You need to look at the help for nested IF statements, maximum of 7 IF statements though

To give you an idea this will return 0 if Cell A1 is 1 or 2 (or zero or a negative number) and 5 if CellA1 is 3

=IF(A1<=2,0,IF(A1=3,5,(next IF here)))

You can add 5 more IFs which should just be enough if you use the less than 2 option to cover your first two buttons
This message was edited by royUK on 2002-10-10 14:14
This message was edited by royUK on 2002-10-10 14:15

#### beenay

##### New Member
Thank you. That was EXACTLY what I needed. Thanks.

#### B_2

##### Board Regular
=IF(A1=1,"0",IF(A1=2,"0",IF(A1=3,"5",IF(A1=4,"10",IF(A1=5,"15",IF(A1=6,"20",IF(A1=7,"25",IF(A1=8,"30",))))))))

try this.....make sure you count the brackets at the end correctly, works fine on EXCEL XP!
This message was edited by B_2 on 2002-10-10 14:17
This message was edited by B_2 on 2002-10-10 14:19

#### Mark W.

##### MrExcel MVP
Yikes!! Simply use...

=CHOOSE(A1,"0","0","5","10")
This message was edited by Mark W. on 2002-10-10 14:22

#### royUK

##### Well-known Member
i have just checked Help and it states:
Up to seven IF functions can be nested as value_if_true and value_if_false arguments to construct more elaborate tests. See the last of the following examples.
This might be different in ExcelXP

#### Mark W.

##### MrExcel MVP
Why bother with IF worksheet functions at all!!! See my previous posting.

#### royUK

##### Well-known Member
Hi Mark

Just checked your CHOOSE function- brilliant. There's always something new to learn with Excel

Roy
This message was edited by royUK on 2002-10-10 14:55

Replies
2
Views
285
Replies
2
Views
479
Replies
2
Views
145
Replies
1
Views
86
Replies
0
Views
344

1,181,929
Messages
5,932,843
Members
436,865
Latest member
JHusk

### We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.

### Which adblocker are you using?

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

### Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

### Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back