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 Feb 28th, 2002, 10:04 AM   #1
Guest
 
Posts: n/a
Default

Not sure of the best way to describe this, but im trying to create a sort of "sliding" vlookup and/or sumif formula. What I need is a formula that can accomplish the following: The first cell in a row (a3, for example) will report a value based on the lookup value in a2, my specified range, and the column index number 1 (for example). Then I need to be able to copy the formula over the next cell (b3), and it adds the lookup value from a2 again, except this time the column index is column 2, instead of column 1. Thats easy enough on its own, but the trick is, in addition to that, I need it to add in the lookup value from b2 also, with the column index number 1 applied to just his value.

Following this, I will copy the forumla to cell c3, and it will add the lookup value in a2 with a column index of 3, the lookup value from b2 with a column index of 2, and the lookup value from c2, with a column index of 1. This repeats out to the right indefinetly.

I suspect this is possible with some relatively simple vlookup and/or sumif combination. Just cant figure out what it is. Im new to this forum, so I appolgize is this has already been discussed. Thanks for your time.
  Reply With Quote
Old Feb 28th, 2002, 10:36 AM   #2
Scott R
Board Regular
 
Join Date: Feb 2002
Location: WA state
Posts: 332
Default

Can you post some simplified inputs and expected outputs for the first couple of occurences. That would help.
Scott R is offline   Reply With Quote
Old Feb 28th, 2002, 11:09 AM   #3
Guest
 
Posts: n/a
Default

No problem. Thanks for your help. I think is what you're looking for.
col.A col.b col.c col.d
row 1 30% 20% 15% 10%
row 2 1000 2000 500 100
row 3 300 800 700 530

The formula im looking for is the one that goes in row 3. The output for cell a3 is 30% times 1000. The output for cell b3 is 30% times 2000 PLUS 20% times 1000. c3 is 30% times 500 PLUS 20% times 2000 PLUS 15% times 1000. And so on. I know I could write a massive series of if statements, but this is going to go out dozens of columns to the right, so I want to avoid that if at all possible. Let me know if you need any other information. Thanks again.
  Reply With Quote
Old Feb 28th, 2002, 03:17 PM   #4
Guest
 
Posts: n/a
Default

  Reply With Quote
Old Mar 1st, 2002, 10:39 AM   #5
Scott R
Board Regular
 
Join Date: Feb 2002
Location: WA state
Posts: 332
Default

What you need is the equivalent of:
SUMPRODUCT($A1:D1,D2:$A2) in cell D3. Unfortunately Excel won't accept the 2nd argument and converts the entry to
SUMPRODUCT($A1:D1,$A2:D2).

Anybody else have any ideas on how to reverse the order of $A2:D2?
Scott R is offline   Reply With Quote
Old Mar 2nd, 2002, 08:24 AM   #6
Aladin Akyurek
MrExcel MVP
 
Aladin Akyurek's Avatar
 
Join Date: Feb 2002
Location: The Hague
Posts: 50,314
Default

Quote:
On 2002-02-28 10:09, Anonymous wrote:
No problem. Thanks for your help. I think is what you're looking for.
col.A col.b col.c col.d
row 1 30% 20% 15% 10%
row 2 1000 2000 500 100
row 3 300 800 700 530

The formula im looking for is the one that goes in row 3. The output for cell a3 is 30% times 1000. The output for cell b3 is 30% times 2000 PLUS 20% times 1000. c3 is 30% times 500 PLUS 20% times 2000 PLUS 15% times 1000. And so on. I know I could write a massive series of if statements, but this is going to go out dozens of columns to the right, so I want to avoid that if at all possible. Let me know if you need any other information. Thanks again.
Given that A1:C3 houses

{0.3,0.2,0.15,0.1;
1000,2000,500,100;
300,800,700,530}

the sample data you provided, along with the expected results in row 3,

in C1 enter:

=SUMPRODUCT($A$1:A1,N(OFFSET($A$2,0,COLUMN($A$2)+COLUMNS($A$2:A2)-COLUMN($A$2:A2)-1)))

Drag this across as far as needed.

My thanks to Scott R for requesting the sample data and intuiting that the first array must be multiplied by the reverse of the second array and also to Juan who had to deal with a sufficiently similar problem.

Aladin

Aladin Akyurek 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:34 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