Round Robin Considering Days Off

Nizick1979

New Member
Joined
Jan 27, 2023
Messages
1
Office Version
  1. 365
Platform
  1. Windows
I would like to create a button in Excel that will pull from a list telling me who would be next to assign a lead to and if possible making sure that they are assigned evenly over the course of time. So for example, We have 3 names Nick, Scott, Tony work days are Monday through Saturday and Scott is off Tuesday, Nick is off Wednesday and Tony is off Thursday. I want the formula to exclude the individuals on their days off and when someone clicks the button it will pull whomever is next assigning in round robin fashion. Is this possible?
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
VBA Code:
Sub NextAssignee()
    Dim names As Range, daysOff As Range, currentDay As String, i As Integer
    Dim nextAssignee As String
    
    Set names = Worksheets("Sheet1").Range("A1:A3") 'change this to the range that contains the names
    Set daysOff = Worksheets("Sheet1").Range("B1:B3") 'change this to the range that contains the days off
    
    currentDay = Weekday(Date)
    
    For i = 1 To names.Count
        If Not Application.Match(currentDay, daysOff(i, 1), 0) Then
            nextAssignee = names(i, 1)
            Exit For
        End If
    Next i
    
    'change this to the range where you want the next assignee to appear
    Worksheets("Sheet1").Range("C1").Value = nextAssignee
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,227
Messages
6,170,848
Members
452,361
Latest member
d3ad3y3

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