MrExcel Message Board

Go Back   MrExcel Message Board > Question Forums > Excel Questions

Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only.

Reply
 
Thread Tools Display Modes
Old May 21st, 2002, 01:08 PM   #1
Flight012
New Member
 
Join Date: May 2002
Posts: 4
Default

I was wondering is there anyway to nest more then 7 functions together. I have just about completed a new form and have a 2 columns that I am working with. They both have 36 rows in them, and the functions are very basic, ie: if a1=b1,c1, and so on. I now am having a problem in the fact that I need to nest 36 - 40 of these to get the form completed.

Thanks,
Greg
Flight012 is offline   Reply With Quote
Old May 21st, 2002, 01:30 PM   #2
WoodyHays
Board Regular
 
Join Date: May 2002
Location: Atlanta, GA
Posts: 185
Default

I assume you are talking about IF statements.

The Excel limit is 7 generations in a statement. This has caused me a lot of grief, but it usually forces me to rethink my formulas which leads to a better method.

WoodyHays is offline   Reply With Quote
Old May 21st, 2002, 01:32 PM   #3
Flight012
New Member
 
Join Date: May 2002
Posts: 4
Default

Yes it is IF statements. I was looking into trying to use VLOOKUP, but I need to take a look and see if that will really work for me.

Thanks,
Greg
Flight012 is offline   Reply With Quote
Old May 21st, 2002, 01:33 PM   #4
Aladin Akyurek
MrExcel MVP
 
Aladin Akyurek's Avatar
 
Join Date: Feb 2002
Location: The Hague
Posts: 50,319
Default

Quote:
On 2002-05-21 12:08, Flight012 wrote:
I was wondering is there anyway to nest more then 7 functions together. I have just about completed a new form and have a 2 columns that I am working with. They both have 36 rows in them, and the functions are very basic, ie: if a1=b1,c1, and so on. I now am having a problem in the fact that I need to nest 36 - 40 of these to get the form completed.

Thanks,
Greg
Try to re-express any regularity the condition and action parts of those IFs must have in a diffrent form. Long chain of IFs even if they are nested can be rewritten as a lookup expression, most notably in terms of VLOOKUP.

Perhaps you would care to post the current IF-formula along with a short description what it's intended to do.
Aladin Akyurek is offline   Reply With Quote
Old May 21st, 2002, 01:42 PM   #5
Flight012
New Member
 
Join Date: May 2002
Posts: 4
Default

Here is the formula if I was able to nest 36-40 if statements together. Right now I am stuck on the maximum of 7 if statements. H17 is a drop-down box containing a name, AX1-AX40 contains names, AY1-AY40 contains a corresponding number for the name.

=IF(H17=AX1,AY1,IF(H17=AX2,AY2,IF H17=AX3,AY3,IF(H17=AX4,AY4,IF(H17=AX5,AY5,IF(H17=AX6,AY6,IF(H17=AX7,AY7,(H17=AX8,AY8,IF(H17=AX9,AY9,IF(H17=AX10,AY10,IF( H17=AX11,AY11,IF(H17=AX12,AY12,IF(H17=AX13,AY13,IF (H17=AX14,AY14,IF(H17=AX15,AY15,IF(H17=AX16,AY16,IF(H17=AX17,AY17,IF(H17=AX18,AY18,IF(H17=AX19,AY19,IF(H17=AX20,AY20,IF( H17=AX21,AY21,IF(H17=AX22,AY22,IF(H17=AX23,AY23,IF(H17=AX24,AY24,IF(H17=AX25,AY25,IF(H17=AX26,AY26,IF(H17=AX27,AY27,IF(H 17=AX28,AY28,IF(H17=AX29,AY29,IF(H17=AX30,AY30,IF(H17=AX31,AY31,IF(H17=AX32,AY32,IF(H17=AX33,AY33,IF(H17=AX34,AY34,IF(H1 7=AX35,AY35,IF(H17=AX36,AY36,IF(H17=AX37,AY37,IF(H17=AX38,AY38,IF(H17=AX39,AY39,IF(H17=AX40,AY40)))))))))))))))))))))))) ))))))))))))))))

Thanks,
Greg
Flight012 is offline   Reply With Quote
Old May 21st, 2002, 01:46 PM   #6
Aladin Akyurek
MrExcel MVP
 
Aladin Akyurek's Avatar
 
Join Date: Feb 2002
Location: The Hague
Posts: 50,319
Default

Quote:
On 2002-05-21 12:42, Flight012 wrote:
Here is the formula if I was able to nest 36-40 if statements together. Right now I am stuck on the maximum of 7 if statements. H17 is a drop-down box containing a name, AX1-AX40 contains names, AY1-AY40 contains a corresponding number for the name.

=IF(H17=AX1,AY1,IF(H17=AX2,AY2,IF H17=AX3,AY3,IF(H17=AX4,AY4,IF(H17=AX5,AY5,IF(H17=AX6,AY6,IF(H17=AX7,AY7,(H17=AX8,AY8,IF(H17=AX9,AY9,IF(H17=AX10,AY10,IF( H17=AX11,AY11,IF(H17=AX12,AY12,IF(H17=AX13,AY13,IF (H17=AX14,AY14,IF(H17=AX15,AY15,IF(H17=AX16,AY16,IF(H17=AX17,AY17,IF(H17=AX18,AY18,IF(H17=AX19,AY19,IF(H17=AX20,AY20,IF( H17=AX21,AY21,IF(H17=AX22,AY22,IF(H17=AX23,AY23,IF(H17=AX24,AY24,IF(H17=AX25,AY25,IF(H17=AX26,AY26,IF(H17=AX27,AY27,IF(H 17=AX28,AY28,IF(H17=AX29,AY29,IF(H17=AX30,AY30,IF(H17=AX31,AY31,IF(H17=AX32,AY32,IF(H17=AX33,AY33,IF(H17=AX34,AY34,IF(H1 7=AX35,AY35,IF(H17=AX36,AY36,IF(H17=AX37,AY37,IF(H17=AX38,AY38,IF(H17=AX39,AY39,IF(H17=AX40,AY40)))))))))))))))))))))))) ))))))))))))))))

Thanks,
Greg
Try:

=IF(COUNTIF($AX$1:$AX$40,H17),VLOOKUP(H17,$AX$1:$AY$40,2,0),"Not Found")

instead.

Addendum. If any selection from the dropdown list in H17 is guaranteed to exist in AX1:AX40, use the shoter formula:

=VLOOKUP(H17,$AX$1:$AY$40,2,0)




[ This Message was edited by: Aladin Akyurek on 2002-05-21 12:49 ]

[ This Message was edited by: Aladin Akyurek on 2002-05-21 13:16 ]
Aladin Akyurek is offline   Reply With Quote
Old May 21st, 2002, 01:48 PM   #7
Troy
New Member
 
Join Date: Apr 2002
Posts: 47
Default

I think this would be perfect for vlookup
Try this

=VLOOKUP(H1,AX1:AY40,2,FALSE)
Troy is offline   Reply With Quote
Old May 21st, 2002, 01:49 PM   #8
Flight012
New Member
 
Join Date: May 2002
Posts: 4
Default

Thank you!

That worked perfect. I guess I need to look more into VLOOKUP.

Thanks again.

Greg
Flight012 is offline   Reply With Quote
Old May 21st, 2002, 02:03 PM   #9
Gary_E
Board Regular
 
Join Date: Feb 2002
Location: Charlotte, NC USA
Posts: 108
Default

I'm sure others have much easier solutions, but if your keen on using the if stmts, this has always worked for me in a pinch. Basically, it just adds a 0 to the value you want.

Value = numeric
=IF(H17=AX1,AY1,0)+IF(H17=AX2,AY2,0)+IF H17=AX3,AY3,0)+......
Value = text
=IF(H17=AX1,AY1,"")&IF(H17=AX2,AY2,"")&IF H17=AX3,AY3,"")+......

__________________
Thxs for tips - this place is a great source for tips & tricks

Gary
Gary_E is offline   Reply With Quote
Old May 21st, 2002, 02:07 PM   #10
Jay Petrulis
MrExcel MVP
 
Jay Petrulis's Avatar
 
Join Date: Mar 2002
Location: Chicago, IL USA
Posts: 2,042
Default

Another way...

=INDIRECT("AY" & MATCH(H17,AX1:AX40,0))

[ This Message was edited by: Jay Petrulis on 2002-05-21 13:08 ]
Jay Petrulis is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 07:36 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
All contents Copyright 1998-2012 by MrExcel Consulting.
diabetic desserts recipes recipes Diabetic Soups Holiday Pizza Recipes Popcorn Recipes Recipes For Microwave Pasta Recipes Casserole Recipes Chili Recipes Curry Recipes Crockpot Recipes Apples Recipes Bread Recipes Vegetarian Recipes Vegetable recipes Desserts Recipes Appetizers Ethnic Recipes Meat Dishes Barbecue Recipes Sauces Recipes Marinade Recipes Low Fat Recipes Frugal Gourmet Kitchen Classics Recipes On The Grill Cook Books Seafood Recipes Cajun Recipes Breads Low Fat Low Fat Breads Bread Machine Recipes Yeast Breads Quick Breads Fat Free Vegetarian Salad Recipes Eggplant Recipes Radish Recipes Tomato Recipes Jalapeno Recipes Potato Recipes Lettuce Recipes Cabbage Recipes Beans Ambrosia Recipes Biscotti Recipes Desserts Low Fat Cookie Recipes Cheesecake Recipes Cake Recipes Pie Recipes Muffin Recipes Custard Recipes Best Appetizers Appetizers Low Fat Salsa Recipes Dip Recipes International Recipes Afghan Recipes Alaska Recipes French Recipes German Recipes Greek Recipes Italian Recipes Spanish Recipes Thai Recipes Korean Recipes Chinese Recipes Mexican Recipes Indian Recipes Beef Recipes Pork Pork & Ham Pork Butts Pork Chop Recipes Pork Ribs Rulled Pork Poultry Recipes Stews Recipes Ground Beef Barbecue Grill Barbecue Smoker All Purpose Sauce BBQ Sauce Barbecue Sauce Carolina BBQ Sauce Pickle Recipes Marinades Smoking Low Fat Appetizers & Dips Low Fat Breakfast Low Fat Cakes Low Fat Cheesecakes Low Fat Cookies Low Fat Desserts Low Fat Fish & Seafood Low Fat Meats Low Fat Pasta Low Fat Pies Low Fat Salads Low Fat Sandwiches Low Fat Sauces & Condiments Low Fat Sides Low Fat Soups Low Fat Vegetarian Baker's Dozen Taste of Home Recipe Book Bon Appetit Cookbook Blacktie Cookbook Buster Cook Book Cookbook USA Cook Book Cook Book Sara's Cookbook Sara's Cookbook Appetizers and Dips Poultry recipes Diabetic recipes Holiday recipes Miscellaneous recipes 110 recipes 1986 Usenet cookbook 2900 recipes Cyberrealm recipes Great sysops of world Specialty recipes Ceideburg recipes Cheese recipes Chili recipes Fruits recipes Garlic recipes Great chefs of NY Londontowne recipes Raisins recipes Recipes for kids US Food Vegetarian recipes Bread recipes Drinks Meat Dishes Brisket recipes Caribou recipes Chicken recipes Filet mignons recipes Pork recipes Swordfish recipes Turkey recipes Pasta recipes Uncategorized recipes Ethnic recipes Canada recipes English recipes Ethiopia recipes Germany recipes Greece recipes Mexican recipes Philippines recipes Welsh recipes Microwave recipes Soups recipes Vegetable recipes Asparagus recipes Barley recipes Brown rice recipes Lentil recipes Mushrooms recipes Salads recipes Wild rice Desserts recipes Cakes recipes Chocolate recipes Cookies recipes Ice cream recipes