MrExcel Message Board
With Macromedia Shockwave Player, you can enjoy multimedia games, learning applications, and product demonstrations on the Web, using exciting new 3D technology. Get it at: http://www.macromedia.com/shockwave/download


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 7th, 2002, 06:59 AM   #1
AciD
 
Join Date: May 2002
Location: France
Posts: 16
Default

Hi, here it is :

=IF(IF(INDEX(temp.xls!A:F;SUM(MATCH("EENU";temp.xls!A:A;0);MATCH("BF304";OFFSET(temp.xls!A1;MATCH("EENU";temp.xls!A:A;0)-1;0;MATCH("FCLI";temp.xls!A:A;0)-MATCH("EENU";temp.xls!A:A;0)+1;1);0))-1;5)<>0;5;6)=5;INDEX(temp.xls!A:F;SUM(MATCH("EENU";temp.xls!A:A;0);MATCH("BF304";OFFSET(temp.xls!A1;EQUIV("EENU";temp.xls!A:A;0)-1;0;MATCH("FCLI";temp.xls!A:A;0)-MATCH("EENU";temp.xls!A:A;0)+1;1);0))-1;IF(INDEX(temp.xls!A:F;SUM(MATCH("EENU";temp.xls!A:A;0);MATCH("BF304";OFFSET(temp.xls!A1;MATCH("EENU";temp.xls!A:A;0)-1;0;MATCH("FCLI";temp.xls!A:A;0)-MATCH("EENU";temp.xls!A:A;0)+1;1);0))-1;5)<>0;5;6));-INDEX(temp.xls!A:F;SUM(MATCH("EENU";temp.xls!A:A;0);MATCH("BF304";OFFSET(temp.xls!A1;MATCH("EENU";temp.xls!A:A;0)-1;0;MATCH("FCLI";temp.xls!A:A;0)-MATCH("EENU";temp.xls!A:A;0)+1;1);0))-1;IF(INDEX(temp.xls!A:F;SUM(MATCH("EENU";temp.xls!A:A;0);MATCH("BF304";OFFSET(temp.xls!A1;MATCH("EENU";temp.xls!A:A;0)-1;0;MATCH("FCLI";temp.xls!A:A;0)-MATCH("EENU";temp.xls!A:A;0)+1;1);0))-1;5)<>0;5;6)))

My pb is i'm searching the value "BF304" with this formula but when it can't find it, it print #N/A.. so i've found a formula to convert #N/A into "0" which is more better (sorry i haven't found the exact translation for type.erreur) :

=IF(TYPE.ERREUR(all_the_upper_formula)="7";"0";"all_the_upper_formula")

the pb is the overall formula is way to big for excel :/

any idea ?

thx.
AciD is offline   Reply With Quote
Old May 7th, 2002, 07:24 AM   #2
AciD
 
Join Date: May 2002
Location: France
Posts: 16
Default

after reading my question, i think i wasn't be very clear..i'll explain the function of my formula :

i have a temp.xls filled with numbers and some references, for exemple at the reference EENU, i have the account bf304 with 2 values in column 5 or 6 (debit or credit).

As the reference bf304 isn't unique i need to search between 2 "great" reference, EENU and FCLI in this case.

after finding the number of the line where is located my bf304, i check which cell (debit or credit) is filled and if credit is filled i negate the result, in the other case i just use the result.

and at least when i can't find bf304(or whatever) between 2 references, i get a #N/A.

and i don't want to cose i do a sum on all the result above..so.. when i have 1542+8794+#N/A+546 i get = #N/A

..quite boring.

hope u'll understand my "english" :p
AciD is offline   Reply With Quote
Old May 7th, 2002, 10:29 AM   #3
Bruno
 
Bruno's Avatar
 
Join Date: Feb 2002
Posts: 467
Default

Acid, your formula is so complicated ...

In the case I have to test for several conditions, I prefer to use some extra columns to register the results.

For example : use column K for the result of your first IF-statement, column L for the result of your second IF-statement, etc.

Doing this, you can split your "longest formula ever" in a way it is easier to follow/understand ...

Hope this helps you back on the track...

Bruno is offline   Reply With Quote
Old May 7th, 2002, 02:03 PM   #4
Nimrod
MrExcel MVP
 
Join Date: Apr 2002
Location: Vancouver BC , Canada
Posts: 6,259
Default

High Acid:
(pun intentional)
I think your problem is interesting an believe it can be solved with an array formula. Could you give me a another example with a little more data ? I really don't want to reverse eng. your code.
Nimrod is offline   Reply With Quote
Old May 7th, 2002, 02:08 PM   #5
zacemmel
 
zacemmel's Avatar
 
Join Date: Apr 2002
Location: Redmond, WA
Posts: 636
Default

I would have to bet that this formula can be rewritten in a much smaller fashion.
zacemmel is offline   Reply With Quote
Old May 7th, 2002, 02:20 PM   #6
Aladin Akyurek
MrExcel MVP
 
Aladin Akyurek's Avatar
 
Join Date: Feb 2002
Location: The Hague
Posts: 40,611
Default

It seems you're looking for the value bf304 in column A. It also seems you have 2 other columns for debit and credit: Which columns are these?

What is the significance/relevance of bf304 being in between EENU and FCLI, apparently also values that occur in A?

Aladin
Aladin Akyurek is offline   Reply With Quote
Old May 7th, 2002, 02:55 PM   #7
Jay Petrulis
MrExcel MVP
 
Jay Petrulis's Avatar
 
Join Date: Mar 2002
Location: Chicago, IL USA
Posts: 2,042
Default

Hi,

Consider using named formulae, especially the intermediate MATCH terms.

A better approach would be to use the database functions in Excel, like DSUM, or going with SUMPRODUCT. For these to work, it would help to name your data table ranges. You might have to use multiple SUMPRODUCT functions together, but it would be much, much shorter and more flexible.

Bye,
Jay

[ This Message was edited by: Jay Petrulis on 2002-05-07 12:24 ]
Jay Petrulis is offline   Reply With Quote
Old May 7th, 2002, 03:32 PM   #8
Jack in the UK
 
Join Date: Feb 2002
Posts: 3,063
Default

well ive read that formula a few times and seems to be fine, but my names Jack in the UK and Aladins been in here and commented, so take his advice,

i say this is far to long, im my books long as needs be, i would split in to 2 3 4 5 6 as many as is simple columns and convert each stage.

or ill get Get Chris D to eat trip!

and as a bonus ill eat my dog, i love kebabs!

alsation kebab, yum! with chillie sauce and salad of cause.
__________________
Free Excel based Web Toolbar available here.

Jack in the UK
J & R Excel Solutions
"making Excel work for you"
Jack in the UK is offline   Reply With Quote
Old May 12th, 2002, 01:11 PM   #9
AciD
 
Join Date: May 2002
Location: France
Posts: 16
Default

"It seems you're looking for the value bf304 in column A. It also seems you have 2 other columns for debit and credit: Which columns are these?

What is the significance/relevance of bf304 being in between EENU and FCLI, apparently also values that occur in A?
"

yes i'm looking for bf304 in column A, the 2 others columns are : Debit in E and Credit in F.

in fact, in my column A i have several part : management, production etc...(named like MNGT, PROD, EENU, etc..). In each part, i can have some account, like bf304, bf514.

That's why i can't do a global search in the column A, i need to define some borders. In this case, EENU and FCLI are my borders.

My pb is, i can't divide the formula in other column coze i need to print the whole thing at the end :/

and the *real* pb is, when i search for some reference like bf344 (or whatever), and when this reference doesn't exist (it happen merely often), it return "#N/A" error instead of a "0"...

How can i replace thoses errors by 0, because i need to sum some of thoses result...
AciD is offline   Reply With Quote
Old May 12th, 2002, 02:11 PM   #10
stevebausch
 
Join Date: May 2002
Posts: 809
Default

Wow.........maybe that sort of code is usual and customary for the spreadsheet guys, but before I ever attempt to create and debug it, I would set up a macro to handle it, and a "ReCalc" button to invoke the macro.
stevebausch 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 +1. The time now is 05:19 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
All contents Copyright 1998-2009 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