How can I do multiple IF's?

beenay

New Member
Joined
Oct 9, 2002
Messages
10
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

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.

royUK

Well-known Member
Joined
Jul 24, 2002
Messages
1,606
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
 

B_2

Board Regular
Joined
Aug 24, 2002
Messages
210
=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
Joined
Feb 10, 2002
Messages
11,654

ADVERTISEMENT

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
Joined
Jul 24, 2002
Messages
1,606
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
Joined
Feb 10, 2002
Messages
11,654
Why bother with IF worksheet functions at all!!! See my previous posting.
 

royUK

Well-known Member
Joined
Jul 24, 2002
Messages
1,606
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
 

Forum statistics

Threads
1,144,449
Messages
5,724,414
Members
422,552
Latest member
Ajit Kumar_1982

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.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

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

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

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
Top