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 18th, 2002, 02:52 PM   #1
rawky1976
New Member
 
Join Date: May 2002
Posts: 3
Default

I have a spreadsheet with the total weekly sales values for five shops, I need to calculate the highest ranking shop for a particular week which I can easily do with say =MAX(C15:C20) but I dont want to display the figure. I need to display the branch name of the highest taking shop.
ie: -
if MAX c15:c20=c15 then display Acton
if MAX c15:c20=c16 then display Bracton
etc
?????????????????????????

Thank You

rawky1976 is offline   Reply With Quote
Old May 18th, 2002, 02:56 PM   #2
sen_edp
Board Regular
 
sen_edp's Avatar
 
Join Date: Mar 2002
Location: Hellas
Posts: 553
Default


hello

take a look , i think it helps

http://www.mrexcel.com/board/viewtop...c=8355&forum=2
__________________
Best Regards
Andreas
sen_edp is offline   Reply With Quote
Old May 18th, 2002, 03:57 PM   #3
Aladin Akyurek
MrExcel MVP
 
Aladin Akyurek's Avatar
 
Join Date: Feb 2002
Location: The Hague
Posts: 50,317
Default

Hope Andreas is referring to a contrib of mine in

http://www.mrexcel.com/board/viewtop...c=3146&forum=2

Adapting that to your situation, I'd suggest to insert a worksheet which you can name Admin. That's where you can keep & compute things you don't want to show to the users.

Activate Admin.

In A2 enter: Max sales [ just a label ]

In B2 enter: =MAX(Sheet1!C15:C20)

In A3 enter: # Shops [ just a label ]

In B3 enter: =ROWS(Sheet1!C15:C20)

Select B2, go to the Name Box on the Formula Bar, type MaxSales.
Using the foregoing proc, name B3 NumShops.

Admin should look like this:

Microsoft Excel - aaRetHighestRankingShop Rawky1976.xls_______________Running: xl2000 : OS = Windows (32-bit) NT 5.00
(F)ile (E)dit (V)iew (I)nsert (O)ptions (T)ools (D)ata (W)indow (H)elp
A14=
*ABCD
1****
2Max sales:alert('=MAX(Sheet1!C15:C20)')>40**
3# Shops:alert('=COUNTA(Sheet1!B15:B20)')>6**
4****
Admin

To see the formula in the cells just click on the cells hyperlink

The above image was automatically generated by [HtmlMaker V1.22]
If you want this code, click here and Colo will email the file to you.
This code was graciously allowed to be modified: by Ivan F Moala All credit to Colo


In the sheet where you have your data in C15:C20,

in E15 enter:

=INDEX(OFFSET($B$15,0,0,NumShops,1),MATCH(MaxSales,OFFSET($C$15,0,0,NumShops,1),0))

in E2 enter and copy down to a few rows:

=IF(COUNTIF(OFFSET($C$15,0,0,NumShops,1),MaxSales)>COUNTA($E$15:E15),INDEX(OFFSET($B$15,MATCH(E15,OFFSET($B$15,0,0,NumShops,1),0),0,NumShops,1),MATCH(MaxSales,OFFSET($C$15 ,MATCH(E15,OFFSET($B$15,0,0,NumShops,1),0),0,NumShops,1),0)),"")

The figure below shows why all this is needed.

Microsoft Excel - aaRetHighestRankingShop Rawky1976.xls_______________Running: xl2000 : OS = Windows (32-bit) NT 5.00
(F)ile (E)dit (V)iew (I)nsert (O)ptions (T)ools (D)ata (W)indow (H)elp
I20=
*ABCDE
14*ShopSales*Highest Rank Shop(s)
15*Acton20*:alert('=INDEX(OFFSET($B$15,0,0,NumShops,1),MATCH(MaxSales,OFFSET($C$15,0,0,NumShops,1),0))')>Tranton
16*Bracton30*:alert('=IF(COUNTIF(OFFSET($C$15,0,0,NumShops,1),MaxSales)%3ECOUNTA($E$15:E15),INDEX(OFFSET($B$15,MATCH(E 15,OFFSET($B$15,0,0,NumShops,1),0),0,NumShops,1),MATCH(MaxSales,OFFSET($C$15,MATCH(E15,OFFSET($B$15,0,0,NumShops,1),0),0 ,NumShops,1),0)),"")')>Drenton
17*Tranton40*:alert('=IF(COUNTIF(OFFSET($C$15,0,0,NumShops,1),MaxSales)%3ECOUNTA($E$15:E16),INDEX(OFFSET($B$15,MATCH(E 16,OFFSET($B$15,0,0,NumShops,1),0),0,NumShops,1),MATCH(MaxSales,OFFSET($C$15,MATCH(E16,OFFSET($B$15,0,0,NumShops,1),0),0 ,NumShops,1),0)),"")')>*
18*Drenton40*:alert('=IF(COUNTIF(OFFSET($C$15,0,0,NumShops,1),MaxSales)%3ECOUNTA($E$15:E17),INDEX(OFFSET($B$15,MATCH(E 17,OFFSET($B$15,0,0,NumShops,1),0),0,NumShops,1),MATCH(MaxSales,OFFSET($C$15,MATCH(E17,OFFSET($B$15,0,0,NumShops,1),0),0 ,NumShops,1),0)),"")')>*
19*Qwerton5**
20*Yerton***
Sheet1

To see the formula in the cells just click on the cells hyperlink

The above image was automatically generated by [HtmlMaker V1.22]
If you want this code, click here and Colo will email the file to you.
This code was graciously allowed to be modified: by Ivan F Moala All credit to Colo


Aladin
Aladin Akyurek is offline   Reply With Quote
Old May 18th, 2002, 04:10 PM   #4
sen_edp
Board Regular
 
sen_edp's Avatar
 
Join Date: Mar 2002
Location: Hellas
Posts: 553
Default

Hello all !

Hello Aladin , Yes you are correct, I had in mind your post for this.
You are doing great with excel formulas ,
I use your posts all the time to get answers - Thanks !
__________________
Best Regards
Andreas
sen_edp is offline   Reply With Quote
Old May 18th, 2002, 07:30 PM   #5
Yogi Anand
MrExcel MVP
 
Join Date: Mar 2002
Location: Michigan USA
Posts: 11,452
Default

Quote:
On 2002-05-18 13:52, rawky1976 wrote:
I have a spreadsheet with the total weekly sales values for five shops, I need to calculate the highest ranking shop for a particular week which I can easily do with say =MAX(C15:C20) but I dont want to display the figure. I need to display the branch name of the highest taking shop.
ie: -
if MAX c15:c20=c15 then display Acton
if MAX c15:c20=c16 then display Bracton
etc
?????????????????????????

Thank You
Hi rawky1976:
Here is another approach. Suppose your data for weekly sales is in cells B15:C20 as shown below

Acton 5
Bracton 7
other1 3
other2 4
other3 2
other4 1

then use the foloowing formula to get the name of the store with the maximum sale for the week:

=INDEX(B15:C20,MATCH(MAX(C15:C20),C15:C20,0),1)

Please post back if it works for you ... otherwise explain a little further and let us take it from there.

Regards!




_________________
Yogi Anand
Edit: Deleted inactive web site reference from hard coded signature


[ This Message was edited by: Yogi Anand on 2003-01-19 16:21 ]
Yogi Anand is offline   Reply With Quote
Old May 19th, 2002, 08:10 AM   #6
Aladin Akyurek
MrExcel MVP
 
Aladin Akyurek's Avatar
 
Join Date: Feb 2002
Location: The Hague
Posts: 50,317
Default

Here is another approach. Suppose your data for weekly sales is in cells B15:C20 as shown below

Acton 5
Bracton 7
other1 3
other2 4
other3 2
other4 1

then use the foloowing formula to get the name of the store with the maximum sale for the week:

=INDEX(B15:C20,MATCH(MAX(C15:C20),C15:C20,0),1)


Another approach?

I wonder.


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 04:42 AM.


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