+ Reply to Thread
Results 1 to 14 of 14

Segregate a long client list into two

  1. #1
    Registered User
    Join Date
    09-14-2011
    Location
    Vancouver, BC
    MS-Off Ver
    Excel 2010
    Posts
    7

    Exclamation Segregate a long client list into two

    Okay I will try to explain this the best I can, please let me know if you have any questions (I have attached a picture and example file for reference). I have an excel report I have to do every week. On the report, I have two types of clients (suppliers and restaurants) with a list of outstanding invoices for each client listed underneath the client name.

    Now, what I need to do is segregate the report into two reports - one for each type of client.

    So basically, I have a large list of clients, I need to seperate it into two different lists.

    The problems I'm facing are:

    1) There is very little on the excel sheet that distinguishes the two client types. One thing might be the invoice numbers. Most restaurants have 5 digit invoice numbers while suppliers have longer more complex numbers with letters and dashes on them.

    2) Clients range from having anywhere from one outstanding invoice to fourty invoices. I'm not sure how I can do a selection like this in a range.

    3) These lists are constantly updated with new clients/removal of old clients.

    What I have been doing is going through the excel sheet and deleting clients one by one until I have only suppliers left. Then doing the same thing again until I only have restaurants left. This is very tedious and takes a very long time.

    Note: The reason I have this issue is that I get the excel sheet as an export from the accounting system, and I have no way to seperate the client types before I export it due to a limitation in the software.

    Thank you!
    Attached Images Attached Images
    Attached Files Attached Files
    Last edited by atrialto; 09-14-2011 at 05:41 PM.

  2. #2
    Forum Expert davegugg's Avatar
    Join Date
    12-18-2008
    Location
    WI, US
    MS-Off Ver
    2010
    Posts
    1,884

    Re: I need help solving this complex puzzle

    I think you could throw a helper column in. Assuming helper column is in column B, you could put this in:
    =IF(A5="Supplier","Supplier",IF(A5="Restaurant",Restaurant",IF(A5<>"","Filter",A4)))

    Drag down to the bottom, and use the filter.

    PS, it is much easier to help you if you post a workbook, not a picture of one.
    Last edited by shg; 09-14-2011 at 05:54 PM.
    Is your code running too slowly?
    Does your workbook or database have a bunch of duplicate pieces of data?
    Have a look at this article to learn the best ways to set up your projects.
    It will save both time and effort in the long run!


    Dave

  3. #3
    Registered User
    Join Date
    09-14-2011
    Location
    Vancouver, BC
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: I need help solving this complex puzzle

    Quote Originally Posted by shg View Post
    Welcome to the forum.

    Please take a few minutes to read the forum rules, and then amend your thread title accordingly.

    Thanks.
    Thanks and sorry!

    Fixed and added a sample worksheet.

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Segregate a long client list into two

    Hello atrialto,

    The following macro has been added to the attached workbook. A button has been added to run the macro for you. There are now two additional sheets named: "Restaurants" and "Suppliers". Each sheet contains the report information for each customer type.

    ThisWorkbook Module COde
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  5. #5
    Registered User
    Join Date
    09-14-2011
    Location
    Vancouver, BC
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Segregate a long client list into two

    Quote Originally Posted by Leith Ross View Post
    Hello atrialto,

    The following macro has been added to the attached workbook. A button has been added to run the macro for you. There are now two additional sheets named: "Restaurants" and "Suppliers". Each sheet contains the report information for each customer type.

    ]
    Hi Leith, thanks so much for trying to help and taking the time to write that program.

    Unfortunately, restaurants are listed as actual restaurant names, think (Applebees, McDonalds), and suppliers have actual names, so I cannot just sort it that way. The file I attached was just a short sample with generic data.

  6. #6
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Segregate a long client list into two

    Hello atrialto,

    I may be able to pull something together but I will need to the actual data. Can you post a workbook with actual data you need sorted?

  7. #7
    Registered User
    Join Date
    09-14-2011
    Location
    Vancouver, BC
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Segregate a long client list into two

    Quote Originally Posted by Leith Ross View Post
    Hello atrialto,

    I may be able to pull something together but I will need to the actual data. Can you post a workbook with actual data you need sorted?
    Hi Leith, thanks again.

    I have attached a complete workbook with real data. Restaurants have invoices that are for example "75429". They are all 5 digits.

    Thx
    Attached Files Attached Files

  8. #8
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Segregate a long client list into two

    Hello atrialto,

    Thanks for posting the workbook. Since you mentioned there are exceptions to the rule for invoices, do you have some examples of this? Is there any logic to the assignment of the source numbers?

  9. #9
    Registered User
    Join Date
    09-14-2011
    Location
    Vancouver, BC
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Segregate a long client list into two

    Quote Originally Posted by Leith Ross View Post
    Hello atrialto,

    Thanks for posting the workbook. Since you mentioned there are exceptions to the rule for invoices, do you have some examples of this? Is there any logic to the assignment of the source numbers?
    Well, I can tell you that all restaurants have 5 digit invoices with very few exceptions, if any. Suppliers have longer invoice numbers, except some of them all have bill back invoices, which can total 5 characters, but they always start with "BB". So a restaurant invoice would look like '74838', and a supplier invoice may lookl like 'BB123'.

    I hope this helps.

  10. #10
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Segregate a long client list into two

    Hello atrialto,

    That bit of information is big help. Thanks.

  11. #11
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Segregate a long client list into two

    Hello atrialto,

    I updated the macro to separate the restaurants and suppliers by using the 5 digit invoice number. If the invoice is 5 digits with no alpha characters then it goes to the "Restaurants" sheet. Otherwise it goes to the "Suppliers" sheet.

    No total lines are include on either sheet. I can easily change the macro to do so, if you need that information included.

    Here is the revised macro code. This has been added to the attached workbook.
    Please Login or Register  to view this content.
    Attached Files Attached Files

  12. #12
    Registered User
    Join Date
    09-14-2011
    Location
    Vancouver, BC
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Segregate a long client list into two

    Hey Leith. That really looks great. Thanks so much for your help. If it's easy to add the totals then yeah that would definitely be nice to have as well.

    Can it be so the restaurants and suppliers worksheets are dynamically created, or do I have to create them myself every time?

    Tx

  13. #13
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Segregate a long client list into two

    Hello atrialto,

    The totals can be added at the bottom easily enough. The macro can add the sheets if they don't exist and if they it can clear them before transferring the data over. Will that work for you?

  14. #14
    Registered User
    Join Date
    09-14-2011
    Location
    Vancouver, BC
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Segregate a long client list into two

    Quote Originally Posted by Leith Ross View Post
    Hello atrialto,

    The totals can be added at the bottom easily enough. The macro can add the sheets if they don't exist and if they it can clear them before transferring the data over. Will that work for you?
    For sure, that sounds great.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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