Figuring out the right funtion

abistricer

New Member
Joined
Mar 3, 2013
Messages
1
I amhaving an issue coming up with an accurate formula for the situation i have below: i have 3 categories 0-20,21-45 and 46-65. i have another two columnssaying where the patient is coming from (Hospital, LCHSA or outpatient) and theamount of hours are required per pateint.
I am looking for a formula to automatically tell me how many patients havehours in one of the 3 options.

such as in Hospital under 0-20 I would like to automatically put in 2 under the category seeing that there are 3 hospitals with 2 patients with hours of 0-20 and 1 patient in hospital under 21-45<o:p></o:p>

thank you for your help!!



Place of patientPatient hours0-2021-4546-65
Hospital1Hospital
LCHSA15LCHSA
Outpatient8Outpatient
Hospital40
Hospital15
LCHSA13
LCHSA45
Outpatient38

<tbody>
</tbody>
<o:p></o:p>
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
Formulas in cells E3:G5. Formula in E3 and copy down and over: =COUNTIFS(Place_of_patient,$D3,Patient_hours,">="&E$1,Patient_hours,"<="&E$2)

Place of patientPatient hours02146
Hospital1204565
LCHSA2Hospital453
Outpatient8LCHSA835
Hospital20Outpatient224
Hospital15
LCHSA13
LCHSA18
Outpatient20
LCHSA13
Hospital24
LCHSA34
Outpatient64
Hospital61
Hospital53
LCHSA5
LCHSA52
Outpatient52
LCHSA4
Hospital29
LCHSA5
Outpatient63
Hospital13
Hospital29
LCHSA58
LCHSA55
Outpatient58
LCHSA61
Hospital25
LCHSA45
Outpatient43
Hospital58
Hospital30
LCHSA47
LCHSA26
Outpatient22
LCHSA11

<tbody>
</tbody>
 
Upvote 0
Or, Formula in E2 and copy through range E2:G4:

=COUNTIFS(Place_of_patient,$D2,Patient_hours,">="&LEFT(E$1,SEARCH("-",E$1)-1),Patient_hours,"<="&REPLACE(E$1,1,SEARCH("-",E$1),""))


Place of patientPatient hours0-2021-4546-65
Hospital1Hospital453
LCHSA2LCHSA835
Outpatient8Outpatient224
Hospital20
Hospital15
LCHSA13
LCHSA18
Outpatient20
LCHSA13
Hospital24
LCHSA34
Outpatient64
Hospital61
Hospital53
LCHSA5
LCHSA52
Outpatient52
LCHSA4
Hospital29
LCHSA5
Outpatient63
Hospital13
Hospital29
LCHSA58
LCHSA55
Outpatient58
LCHSA61
Hospital25
LCHSA45
Outpatient43
Hospital58
Hospital30
LCHSA47
LCHSA26
Outpatient22
LCHSA11

<tbody>
</tbody>
 
Upvote 0

Forum statistics

Threads
1,217,363
Messages
6,136,109
Members
449,993
Latest member
Sphere2215

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top