mark hansen
Well-known Member
- Joined
- Mar 6, 2006
- Messages
- 534
- Office Version
- 2016
- Platform
- Windows
I have a schedule that has people down the left side, and dates across the top. We enter our schedule using single letter codes such as “C”, “L” etc and the daily entry is something like “C L” (or “C{space}L”) to indicate they are in clinic for the AM and Lab for the PM. Some entries are C{space}C for clinic in the AM and PM.
I need to count up how many “C “ and “ C” there Are for a person in a given date range. I made a grid on another sheet that has the left column matching the list of names in the schedule sheet. Across the top are the codes used in the schedule and I have a beginning and ending date.
So, four variables – beginning date, Ending date, person’s name and schedule code.
The entire schedule range name is “SCHEDULE”.
The Providers range names in the Schedule sheet is “sProvider”
The dates range name in the schedule sheet is sDates
So far I have a formula =LEFT(INDEX(SCHEDULE,MATCH(CA27,sProvider,0),MATCH(CA21,sDate,0)),2)
This looks at the provider name (CA27) and the beginning date (CA21) and returns what I expect (C{space}). (I usually build long formulas from the inside out, but got stuck when it came time to get the range for the countifs).
Problem (I think)
I need to look at the row with the providers name in the SCHEDULE range beginning at the beginning date through the ending date and count how many times C{space} is in the first 2 characters of the cells in the range.
How would I define the range for the countifs? I’ll be adding that number to the amount of times I find {space}C is found in the right two characters in same range.
If you are wondering why I can’t just count the letter “C” it’s because some schedule codes are “CA” for an all-day code. That’s why they use a space to separate AM and PM.
Thanks for any help or insight.
Mark
I need to count up how many “C “ and “ C” there Are for a person in a given date range. I made a grid on another sheet that has the left column matching the list of names in the schedule sheet. Across the top are the codes used in the schedule and I have a beginning and ending date.
So, four variables – beginning date, Ending date, person’s name and schedule code.
The entire schedule range name is “SCHEDULE”.
The Providers range names in the Schedule sheet is “sProvider”
The dates range name in the schedule sheet is sDates
So far I have a formula =LEFT(INDEX(SCHEDULE,MATCH(CA27,sProvider,0),MATCH(CA21,sDate,0)),2)
This looks at the provider name (CA27) and the beginning date (CA21) and returns what I expect (C{space}). (I usually build long formulas from the inside out, but got stuck when it came time to get the range for the countifs).
Problem (I think)
I need to look at the row with the providers name in the SCHEDULE range beginning at the beginning date through the ending date and count how many times C{space} is in the first 2 characters of the cells in the range.
How would I define the range for the countifs? I’ll be adding that number to the amount of times I find {space}C is found in the right two characters in same range.
If you are wondering why I can’t just count the letter “C” it’s because some schedule codes are “CA” for an all-day code. That’s why they use a space to separate AM and PM.
Thanks for any help or insight.
Mark