Excel Work Schedule Question

I have an Excel spreadsheet (attached) that is a visual scheduling for employees. The "x's" in the spreadsheet designate each 15 minute period the employee is scheduled for.

I just want a formula (no arrays, please) that can find the first "x" in the column, and return the corresponding starting time, along with the last "x" in the column, and return the corresponding ending time.

My spreadsheet is attached. Thanks in advance for helping make my scheduling job easier!

Thanks.
Schedule-EE.xlsx
Cactus1993OwnerAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Martin LissOlder than dirtCommented:
It's not really a problem but I wanted to mention that there aren't any x's, just +'s. The question I have is that you show in the workbook that AL should show 2:00pm to 6:45pm but while the color goes to 6:45, the last "+" is in 5:45-6-:00, so given what's there should AL show 2:00PM to 6:00PM?

My solution will be via a user defined function which you will be able to use exactly like a formula, but it will require saving the workbook in xlsm format. Is that OK?
1
Saqib Husain, SyedEngineerCommented:
This formula will give the desired schedule based on the occurences of the + sign

=TEXT(INDEX($A$9:$A$60,MATCH("+",OFFSET($B$8,1,MATCH(K14,$C$3:$H$3,0),52),0)),"[$-409]h:mm AM/PM;@")&" to "&TEXT(INDEX($B$9:$B$60,MATCH("+",OFFSET($B$8,1,MATCH(K14,$C$3:$H$3,0),52))),"[$-409]h:mm AM/PM;@")
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Martin LissOlder than dirtCommented:
SHS' solution probably works but here's a UDF. If you need help implementing it let me know.

Usage:
To get the hours for employee "AL"
=gethours(8)       8 is the column number

Function GetHours(EmpCol As Integer) As String
Dim lngRow As Long
Dim lngStart As Long

With ActiveSheet
    For lngRow = 9 To .UsedRange.Rows.Count
        If .Cells(lngRow, EmpCol) = "+" Then
            lngStart = lngRow
            Exit For
        End If
    Next
    For lngRow = lngStart + 1 To .UsedRange.Rows.Count
        If .Cells(lngRow, EmpCol) = "" Then
            lngRow = lngRow - 1
            Exit For
        End If
    Next
    GetHours = .Cells(3, EmpCol) & " " & .Cells(lngStart, "A").Text & " to " & .Cells(lngRow, "B").Text
End With

End Function

Open in new window

0
Cactus1993OwnerAuthor Commented:
Martin: Yes ... they were "+" and not "x" signs ... my bad. Sorry for that. The blank shaded cells are the possible "overage" hours the employees could work, and the shaded with "+" signs are the actual scheduled hours. And I really needed a formula, not a UDF, but thank you, though!

Saqib: Your formula is perfect. It does exactly what I need it to. Thank you!
0
Cactus1993OwnerAuthor Commented:
Martin: Yes ... they were "+" and not "x" signs ... my bad. Sorry for that. The blank shaded cells are the possible "overage" hours the employees could work, and the shaded with "+" signs are the actual scheduled hours. And I really needed a formula, not a UDF, but thank you, though!

Saqib: Your formula is perfect. It does exactly what I need it to. Thank you!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.