+ Reply to Thread
Results 1 to 16 of 16

Return next name in a list-a rotation

  1. #1
    Registered User
    Join Date
    01-27-2015
    Location
    St. Louis, MO
    MS-Off Ver
    2013 Professional
    Posts
    23

    Return next name in a list-a rotation

    I have a sheet that will have a list of customers. When a new customer is added I want a salesperson (from a list on another sheet) assigned to that customer based on the order of the list.
    Date is in A. Customer name is in B. Salesperson would be in C.
    Once there is a date inputted a salesperson would be assigned in C. The first customer would get salesperson A, the second would get salesperson B, and so on. Once the last salesperson in the list has been assigned it would go back to salesperson A.

  2. #2
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Return next name in a list-a rotation

    Submit an example workbook with before and after examples.

  3. #3
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Return next name in a list-a rotation

    Hi wanabacat (hate dogs?)

    See if the formula in the attached sheet works for you.
    Attached Files Attached Files
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  4. #4
    Registered User
    Join Date
    01-27-2015
    Location
    St. Louis, MO
    MS-Off Ver
    2013 Professional
    Posts
    23

    Re: Return next name in a list-a rotation

    MarvinP, I don't hate dogs, I just prefer my kitties over dogs.
    That formula would work but it needs to be modified some how to accommodate a changing list. I don't know if I'll be able to use a formula because the list of salespeople would be changing. Some leave then we get new ones. When one gets removed from the list it would change who was assigned to that customer.
    Even though MarvinP figured out what I was explaining, I have attached the example I set up.
    Example-Salespeople Assignment Rotation.xlsx

  5. #5
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: Return next name in a list-a rotation

    A changing list of salespeople...

    If change "one leaves, another replaces them immediately" then the number of sales people doesn't change and you can assign Salesperson1, Salesperson2, ... and just change the names of those salespeople. (Its equivalent to an unchanging sales force.)

    If the situation is that sometimes they leave, sometimes there are hires, but not simultaniously, what ar your procedures?

    If you a salesperson leaves, are their accounts assigned to the remaining sales force?

    Of more import, what do you do when you hire a new sales person, do existing accounts get assigned to that new person, without regard for the existing client/salesperson relationship?

    As a record keeper, Excel would be good for client>salesperson.

    But using a logical procedure to assign clients to salespeople will result in human issues.
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  6. #6
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Return next name in a list-a rotation

    Hi,

    To answer this problem correctly I/we need some more details.
    Does the order of the Salesperson list ever change?
    Will there be more than 1 salespeople deleted off the list at a time?
    Does the salesperson name need to stay with that customer after they are deleted from the list, or updated with another salesperson's name?
    What should happen if/when a person sorts the salesperson list?

    Can I/we use VBA code to help with this problem? I tried not to use code in my last answer, that I didn't like much, BTW. I'll wait for your answer before working on some code.

  7. #7
    Registered User
    Join Date
    01-27-2015
    Location
    St. Louis, MO
    MS-Off Ver
    2013 Professional
    Posts
    23

    Re: Return next name in a list-a rotation

    The number of salespeople is constantly changing. This spreadsheet isn't a client database. It's just for new ups that come in through the internet or phone. The business development center gets the lead then it is assigned to a salesperson. The sheet is to make sure that the new leads are assigned evenly. Once the salesperson takes over the lead then they will input them in our contact management system.

  8. #8
    Registered User
    Join Date
    01-27-2015
    Location
    St. Louis, MO
    MS-Off Ver
    2013 Professional
    Posts
    23

    Re: Return next name in a list-a rotation

    The list won't change order.
    Salespeople will be deleted as they leave.
    The new salespeople will be added to the end of the list.
    I will set it so that the list cannot be sorted.
    When a salesperson leaves, any customer they were assigned to needs to remain the same.
    VBA would be good and I think that will be the only way since I don't want the names assigned to change.

  9. #9
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Return next name in a list-a rotation

    I'm having trouble dealing with this problem in VBA...

    What if the person just above the one about be entered has been deleted from the list on sheet 2?

    So my program is going to look for the salesperson just above the one about to be entered in the list on sheet2. What if they are gone? Should I look two places above the person about to be entered? Then, what if this is the first person in the list. I need to look at the bottom person? confused:

    I seem to be on an "off" day on how to resolve these exceptions. I'll work on it later.

  10. #10
    Registered User
    Join Date
    01-27-2015
    Location
    St. Louis, MO
    MS-Off Ver
    2013 Professional
    Posts
    23

    Re: Return next name in a list-a rotation

    MarvinP, you are awesome. That's where I was when I decided to post on here. My thoughts and ideas were going in circles and I got lost before I really got started. I'm out of wine, thinking juice, and there is a snow storm going on right now so I can't go get any.
    If it turns out it's too complicated and just can't be done, then I'll just put a formula next to their names in the list that will keep count of how many deals they have and the BDC rep can just manually keep track of who's on deck next.

  11. #11
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Return next name in a list-a rotation

    OK wannabacat (with kittens).

    To make this work I needed to have more stuff on the Salesperson sheet. I've added 2 columns and an extra table. Instead of removing a salesperson name you will need to simply make them Inactive using Column B validation dropdown. If you add a salesperson you will also need to make them active. Then in Column C pull down the formula as I need this to build the Active salesperson table in Column E. Column E formulas need to be pulled down far enough to include all Active salespeople.

    NOW - the macro gets triggered when you enter (or change) something in Col A AND Col C in that same row is blank. The macro will find the next active salesperson in line and put them below the last name in Col C.

    I hope this works for you. See the attached. Private Message me if it doesn't work as I'll see a PM before an updated post.
    Attached Files Attached Files

  12. #12
    Forum Expert Crooza's Avatar
    Join Date
    10-19-2013
    Location
    Hunter Valley, Australia
    MS-Off Ver
    Excel 2003 /7/10
    Posts
    2,082

    Re: Return next name in a list-a rotation

    Here's a solution that uses only formulas (no VBA) but you need to give the salespersons start and finish dates so only salespeople working at teh particular date of a new job get allocated. It should if it works properly allocate the next available salerep that is working on the appropriate date. If a salesperson is working then I simply put their finish date as a long time in the future (2099). If new sales people start simply add them to the bottom of the list. If a sales person finishes then put his finish date in so he doesn't get allocated in future events.

    good luck - please test though
    rotating%20list(2).xlsx

    Edit Sorry I just changed the file to the correct one
    Last edited by Crooza; 03-01-2015 at 03:53 AM.
    Happy with my advice? Click on the * reputation button below

  13. #13
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Return next name in a list-a rotation

    Hi Crooza,

    Great formula, it is something I need to study to understand.

    The problem is that the salespeople will change when with new or old hire dates. For example, what happens if a salesperson takes a leave and comes back later to work again?

    I believe the OP needs to have the Salesperson put into Column C using VBA so no formula is needed. That way they won't change with other changes. I believe this then mandates a VBA solution and not formulas.

  14. #14
    Forum Expert Crooza's Avatar
    Join Date
    10-19-2013
    Location
    Hunter Valley, Australia
    MS-Off Ver
    Excel 2003 /7/10
    Posts
    2,082

    Re: Return next name in a list-a rotation

    MarvinP Yeah its a bit confusing. You might be right VBA might be the answer but I still think the formula basis works - you just need to put sales reps on annual leave as finishing and when tyhey return create a new line for them. I've allowed 49 lines of data for sales reps but I don't see why you couldn't make it longer to accomodate a bigger team and the fact that staff will be going away and returning. Of course there are some issues for both VBA AND formula in regards to what happens to a salesreps clients when he goes on leave or resigns. Do these customers need to be reallocated to another salesrep?

    Anyway to help you understand the formula it's simply trying to get an array of all the index positions (row number -1) from the sales team that are available in the date period for the customer AND that are greater than the previous matched salesrep. The arrays look something like this {0,2,3,0,5} meaning that salesreps 2,3 and 5 are available. If the last sales rep was 3 then it elimates 1,2 and 3 and then converts 0's to 10's and takes the minimum left. It will look something like this {10,10,10,10,5} so the next available salesrep is the lowest being 5. If it returns an error it simply goes back to the minimum from the original array (substituting 0's for 10's) so it looks like this {10,2,3,10,5} so the minimum is 2 in this case and goes back to the top of the avaiable list of salesreps. If there's an easier way to do this let me know. As I said earlier it allows salesreps to be added and chnage their date so their availability is always checked and included as part of the allocation.

  15. #15
    Registered User
    Join Date
    01-27-2015
    Location
    St. Louis, MO
    MS-Off Ver
    2013 Professional
    Posts
    23

    Re: Return next name in a list-a rotation

    MarvinP the VBA code works great! I added some columns in but I was able to adjust the code.
    Thanks again!!

  16. #16
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Return next name in a list-a rotation

    Great to hear this solves this, easy to state and hard to solve, problem.

    Sorry I needed to add a few extra columns. The column E could be used as a Validation list of Active salespeople. If that isn't a need then I could use VBA to determine the next person in the line:
    Please Login or Register  to view this content.
    Which is really the first active person in the A column List.

    Here is code that would allow you to eliminate Columns E and C if you wanted to clean up your Salespeople sheet.

    Please Login or Register  to view this content.
    Thanks for the rep.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Pie in pie chart rotation
    By anand_ger in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 07-09-2014, 09:51 AM
  2. Rotation Schedule
    By uniks in forum Excel General
    Replies: 1
    Last Post: 03-16-2014, 08:58 PM
  3. Server Rotation
    By KSM244 in forum Excel General
    Replies: 0
    Last Post: 11-04-2013, 07:53 PM
  4. Post Rotation
    By excedrin1997 in forum Excel General
    Replies: 1
    Last Post: 10-26-2012, 05:14 AM
  5. [SOLVED] rotation schedule
    By sam in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-13-2006, 07:45 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1