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 17th, 2002, 03:37 PM   #1
RET79
Board Regular
 
Join Date: Mar 2002
Location: England, UK.
Posts: 526
Default

Two columns, like this

Name Data
RET79 534536
5345353234
98981
TJH 534530
424204240
242420


etc.

Now, I want to set something up so that if someone types RET79 in Cell D1 that Cell E1 will return the sum of the data for RET79.

Have played with sumif array forumlas but not manager to do it yet, can you help?

many thanks,

RET79
RET79 is offline   Reply With Quote
Old May 17th, 2002, 03:49 PM   #2
Rocky E
Board Regular
 
Join Date: Feb 2002
Location: North Alabama, USA
Posts: 105
Default

Quote:
On 2002-05-17 14:37, RET79 wrote:
Two columns, like this

Name Data
RET79 534536
5345353234
98981
TJH 534530
424204240
242420


etc.

Now, I want to set something up so that if someone types RET79 in Cell D1 that Cell E1 will return the sum of the data for RET79.

Have played with sumif array forumlas but not manager to do it yet, can you help?

many thanks,

RET79
Sure if the names are in A:A and the data in B:B then D1= RET79 set E1=SUMIF(A:A,D1,B:B) No CSE required.


__________________
Hope this helps!

Rocky

<h6>"Be not the first by whom the New are try'd,
Nor yet the last to lay the Old aside."
Alexander Pope (1688-1744).</h6>
Rocky E is offline   Reply With Quote
Old May 17th, 2002, 03:54 PM   #3
RET79
Board Regular
 
Join Date: Mar 2002
Location: England, UK.
Posts: 526
Default

Rocky,

Many thanks for your solution, I have never seen one quite like that.

However, and this is probably my fault, but, this will only work given that the labels fill the cells in col A.

EG A2=RET79, A7 = ROCKY Data from B2 to B12.

So, if user types ROCKY in D1, then, E1 will return SUM(B7:B12) in effect.

With your soultion it only returns Sum(B7)

I'm sorry, I should have tried to get a HTML table so you could see it clearer.

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

Ret:
Can't you just drag & fill the names beside the data so that Rocky's great solution will work ?
Do it that way will give you more options in the future as well i.e. PVT's etc.
__________________

<MARQUEE>...........Never be afraid to try something new. Remember, amateurs built the ark, professionals built the Titanic...............The easiest thing to find is fault, don't be easy !.. --Anonymous--...</marquee>
Nimrod is offline   Reply With Quote
Old May 17th, 2002, 04:02 PM   #5
RET79
Board Regular
 
Join Date: Mar 2002
Location: England, UK.
Posts: 526
Default

Nimrod,

Yes, I'm aware that doing that would work, however, due to various reasons the table structure has to be that way and filling in the labels will not be acceptable for the users of my spreadsheets.

I agree, it is a great solution and I have just realised I have been using many unecessary array formulas in the past.

RET79
RET79 is offline   Reply With Quote
Old May 17th, 2002, 04:14 PM   #6
RET79
Board Regular
 
Join Date: Mar 2002
Location: England, UK.
Posts: 526
Default

I am not either a fan of using columns to make intermediate calculations and then hiding the columns, I am seeking an elegant solution, have tried hard myself but not succeeded.

RET79
RET79 is offline   Reply With Quote
Old May 17th, 2002, 04:22 PM   #7
RET79
Board Regular
 
Join Date: Mar 2002
Location: England, UK.
Posts: 526
Default

But if I don't get another solution then I think I will use an intermediate column with all the labels filled in then I can use Rocky's elegant solution.

RET79
RET79 is offline   Reply With Quote
Old May 17th, 2002, 04:23 PM   #8
Nimrod
MrExcel MVP
 
Join Date: Apr 2002
Location: Vancouver BC , Canada
Posts: 6,259
Default

Here's a solution if you willing to hide a column.

IF
colA = Names
ColB = Hidden Column
ColC = Numbers
D2 = where you will enter Name to sum
D1 = Place sum Forumla

--ColB ( the hidden column)
Assuming starting data in A2:
Place this formula in B2 and drag down column
=IF(ISBLANK(A2),B1,A2)
(then hide colmn)

D1 = =SUMIF(B:B,D2,C:C)

D2 = enter criteria i.e. persons name

note( hidden column can be anywhere on sheet)..change formula accordingly
Nimrod is offline   Reply With Quote
Old May 17th, 2002, 04:27 PM   #9
RET79
Board Regular
 
Join Date: Mar 2002
Location: England, UK.
Posts: 526
Default

Nimrod,

Great solution and I will tuck that hidden column away somewhere away from the calcs, great idea, thankyou.

RET79
RET79 is offline   Reply With Quote
Old May 17th, 2002, 04:36 PM   #10
Nimrod
MrExcel MVP
 
Join Date: Apr 2002
Location: Vancouver BC , Canada
Posts: 6,259
Default

Cool Dude:
May I suggest that you not only hide it but use format-- Protection to hide and protect the formulas... Anyway glad you happy ...cheers
__________________

<MARQUEE>...........Never be afraid to try something new. Remember, amateurs built the ark, professionals built the Titanic...............The easiest thing to find is fault, don't be easy !.. --Anonymous--...</marquee>
Nimrod 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 12:47 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