![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Apr 2002
Posts: 43
|
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?
|
|
|
|
|
|
#2 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Austin, Texas USA
Posts: 11,654
|
Use a PivotTable. How is your data organized?
|
|
|
|
|
|
#3 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: The Hague
Posts: 50,317
|
Quote:
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 |
|
|
|
|
|
|
#4 |
|
New Member
Join Date: Apr 2002
Posts: 43
|
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. |
|
|
|
|
|
#5 |
|
Board Regular
Join Date: Mar 2002
Location: Toronto
Posts: 173
|
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 |
|
|
|
|
|
#6 | ||||||||||||||||||||||
|
MrExcel MVP
Join Date: Feb 2002
Location: Austin, Texas USA
Posts: 11,654
|
And, here's the PivotTable...
*
* |
||||||||||||||||||||||
|
|
|
|
|
#7 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: The Hague
Posts: 50,317
|
Quote:
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 ] |
|
|
|
|
|
|
#8 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: Austin, Texas USA
Posts: 11,654
|
Quote:
[ This Message was edited by: Mark W. on 2002-04-05 09:34 ] |
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|