IF function with multiple criteria

Horus73

Board Regular
Joined
May 7, 2003
Messages
72
Hi,
How will the formula be in the following situation?

Cel A1- 3 options for input
Jean, Pete, Jim


C A2 - If function in which I want to combine three ifs
=IF(A1="jean";"+4 points";"")
=IF(A1="Pete";"+2 points";"")
=IF(A1="Jim";"+5 points";"")

Thus, CA2 should contain one IF formula. If Jim is entered in A1 then it will give +5 points, but if Pete is entered then it will show +2 points ...and so on.

Thanks again!
Marc
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
=if(A1="jean","+4 points",if(A1="Pete","+2 points",if(A1="Jim","+5 points","Name not found")))

Hope this helps!
 
Upvote 0
Thanks, is there a maximum on the number of criteria in one IF formula?
I get the impression there is, based on above mentioned search.

Marc
 
Upvote 0
Horus73 said:
Thanks, is there a maximum on the number of criteria in one IF formula?
I get the impression there is, based on above mentioned search.

Marc

1] A limit imposed by cognition: at most 4.

2] A nesting limit imposed by Excel's design: 7.

There are enough folks, not detered by any of the above, will happily tell you: chain them up to any number you want.
 
Upvote 0
How does one "chain them up"? I have a need to have the following done to help in compiling demographic data. Here is the formula that I had wanted to use, but of course,I'm stopped at 7.

=IF(I2>64,"65+",IF(I2<=19,"0-19",IF(I2<=24,"20-24",IF(I2<=29,"25-29",IF(I2<=34,"30-34",IF(I2<=39,"35-39",IF(I2<=44,"40-44",IF(I2<=49,"45-49",IF(I2<=54,"50-54",IF(I2<=59,"55-59",IF(I2<=64,"60-64")))))))))))

Can someone tell me how I can get around the limit of 7?
 
Upvote 0
Katherine Mason said:
How does one "chain them up"? I have a need to have the following done to help in compiling demographic data. Here is the formula that I had wanted to use, but of course,I'm stopped at 7.

=IF(I2>64,"65+",IF(I2<=19,"0-19",IF(I2<=24,"20-24",IF(I2<=29,"25-29",IF(I2<=34,"30-34",IF(I2<=39,"35-39",IF(I2<=44,"40-44",IF(I2<=49,"45-49",IF(I2<=54,"50-54",IF(I2<=59,"55-59",IF(I2<=64,"60-64")))))))))))

Can someone tell me how I can get around the limit of 7?

Since I'm not one of those folks who would suggest chaining them up, here is a formula that can replace your current IF-formula:

=VLOOKUP(I2,$E$1:$F$11,2)
Book1
EFGHI
100-19
22020-240-1915
32525-2955-5958
43030-3445-4945
53535-3950-5453
64040-4435-3937
74545-490-1915
85050-5445-4947
95555-5935-3935
106060-640-196
116565+35-3939
Sheet1
 
Upvote 0
For Katherine, try:

=IF(I2>64,"65+",IF(I2<=19,"0-19",INT(I2/5)*5&"-"&INT(I2/5)*5+4))

--Tom
 
Upvote 0
This solution has only 3 IFs ..... does it work for you ?
This solution ... if you took out the >65 and <19 would work all numbers from 10 to 99 in ranges from 0-4 and 5-9 :wink:

=IF(I2>64,"65+",IF(I2<=19,"0-19",IF(VALUE(RIGHT(I2))<5,LEFT(I2,1)&"0-"&LEFT(I2,1)&"4",LEFT(I2,1)&"5-"&LEFT(I2,1)&"9")))
 
Upvote 0
Having only skimmed this thread, it looks like you're trying to do a histogram. Excel will do this for you automatically... you'll need to go to Add Ins, add the Analysis Tool Pak, and then go to Data Analysis under the Tools menu and choose Histogram.
 
Upvote 0

Forum statistics

Threads
1,215,215
Messages
6,123,668
Members
449,114
Latest member
aides

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
Back
Top