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 Apr 5th, 2002, 09:30 AM   #1
Frankie needs HELP
New Member
 
Join Date: Apr 2002
Posts: 43
Default

I've got a list of patients who have been dignosed with various illnesses (some the same), each patient had a waiting time in which they had to wait until they were admitted. How do I get the average waiting time for the diagnosis?
Frankie needs HELP is offline   Reply With Quote
Old Apr 5th, 2002, 09:33 AM   #2
Mark W.
MrExcel MVP
 
Join Date: Feb 2002
Location: Austin, Texas USA
Posts: 11,654
Default

Use a PivotTable. How is your data organized?
Mark W. is offline   Reply With Quote
Old Apr 5th, 2002, 09:40 AM   #3
Aladin Akyurek
MrExcel MVP
 
Aladin Akyurek's Avatar
 
Join Date: Feb 2002
Location: The Hague
Posts: 50,317
Default

Quote:
On 2002-04-05 08:30, Frankie needs HELP wrote:
I've got a list of patients who have been dignosed with various illnesses (some the same), each patient had a waiting time in which they had to wait until they were admitted. How do I get the average waiting time for the diagnosis?

One way:

Make a unique list of diganoses, lets say, in column F from F2 on.

Lets suppose that the diagnosis data is in A from A2 on and waiting times in B from B2 on.

In G2 enter:

=SUMIF($A$2:$A$100,F2,$B$2:$B$100)/MAX(1,COUNTIF($A$2:$A$100,F2))

Note. It would be nice if you also include some sample data when you post a question.

Aladin
Aladin Akyurek is offline   Reply With Quote
Old Apr 5th, 2002, 10:03 AM   #4
Frankie needs HELP
New Member
 
Join Date: Apr 2002
Posts: 43
Default

Waiting Diagnosis
Time

154 Varicose veins
286 Hernia
246 Tonsillectomy
188 Hysterectomy
18 Bowel cancer
0 Heart Attack
274 Stomach ulcer
222 Stomach ulcer
223 Hernia
124 Varicose veins
542 Hernia
234 Tonsillectomy
360 Stomach ulcer
2 Appendectomy
1 Heart Attack
324 Hernia
300 Varicose veins
2 Heart Attack

This is my data. I have to find the average waiting time for the diagnosis.
Frankie needs HELP is offline   Reply With Quote
Old Apr 5th, 2002, 10:11 AM   #5
Duane
Board Regular
 
Join Date: Mar 2002
Location: Toronto
Posts: 173
Default

Frankie - are those times in minutes, hours or...??

Aladin - I too find using SUMIF/COUNTIF a little easier than CSE formulas, good shot.
__________________
Regards, Duane
h. Office2003 in WinXP
o. Office2007 in Win7
Duane is offline   Reply With Quote
Old Apr 5th, 2002, 10:16 AM   #6
Mark W.
MrExcel MVP
 
Join Date: Feb 2002
Location: Austin, Texas USA
Posts: 11,654
Default

And, here's the PivotTable...

*
Average of Waiting Time
*Diagnosis*Total
Appendectomy*2
Bowel cancer*18
Heart Attack*1
Hernia*343.75
Hysterectomy*188
Stomach ulcer*285.3333333
Tonsillectomy*240
Varicose veins*192.6666667
Grand Total194.4444444

*
Mark W. is offline   Reply With Quote
Old Apr 5th, 2002, 10:30 AM   #7
Aladin Akyurek
MrExcel MVP
 
Aladin Akyurek's Avatar
 
Join Date: Feb 2002
Location: The Hague
Posts: 50,317
Default

Quote:
On 2002-04-05 09:03, Frankie needs HELP wrote:
Waiting Diagnosis
Time

154 Varicose veins
286 Hernia
246 Tonsillectomy
188 Hysterectomy
18 Bowel cancer
0 Heart Attack
274 Stomach ulcer
222 Stomach ulcer
223 Hernia
124 Varicose veins
542 Hernia
234 Tonsillectomy
360 Stomach ulcer
2 Appendectomy
1 Heart Attack
324 Hernia
300 Varicose veins
2 Heart Attack

This is my data. I have to find the average waiting time for the diagnosis.
Suppose that the above sample is in A1:B19.

Lets create a diagnosis list in D from D1 on. The following is extracted from your sample, using Advanced Filter:

{"Diagnosis";
"Varicose veins";
"Hernia";
"Tonsillectomy";
"Hysterectomy";
"Bowel cancer";
"Heart Attack";
"Stomach ulcer";
"Appendectomy"}

In E1 enter:

=MATCH(9.99999999999999E+307,A:A)

In E2 enter and copy down:

=SUMIF(OFFSET($B$2,0,0,$E$1-1,1),D2,OFFSET($A$2,0,0,$E$1-1,1))/MAX(1,COUNTIF(OFFSET($B$2,0,0,$E$1-1,1),D2))

This formula-based method is fully automatic. Additionally, you don't have to adjust the formulas when you add more waiting times with associated diagnoses to the data area.

You might want to keep this around. It can be a handy alternative to the Pivot Table approach.

Here is what you get in the result area:

{"Diagnosis",19;
"Varicose veins",192.666666666667;
"Hernia",343.75;
"Tonsillectomy",240;
"Hysterectomy",188;
"Bowel cancer",18;
"Heart Attack",1;
"Stomach ulcer",285.333333333333;
"Appendectomy",2}

Aladin

[ This Message was edited by: Aladin Akyurek on 2002-04-05 09:32 ]
Aladin Akyurek is offline   Reply With Quote
Old Apr 5th, 2002, 10:33 AM   #8
Mark W.
MrExcel MVP
 
Join Date: Feb 2002
Location: Austin, Texas USA
Posts: 11,654
Default

Quote:

This formula-based method is fully automatic. Additionally, you don't have to adjust the formulas when you add more waiting times with associated diagnoses to the data area.


Aladin
Dynamic ranges can be used to define the extent of the data source of a PivotTable as well. Futhermore, if Excel's built-in Data Form is used to update the data list it automatically handles the range extension -- without the volatility associated with OFFSET.

[ This Message was edited by: Mark W. on 2002-04-05 09:34 ]
Mark W. 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 09:31 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