+ Reply to Thread
Results 1 to 23 of 23

Search and list multiple names

  1. #1
    Forum Contributor ANDREAAS's Avatar
    Join Date
    05-06-2013
    Location
    Port Elizabeth, South Africa
    MS-Off Ver
    Excel 2007 / 2010
    Posts
    368

    Search and list multiple names

    Hi

    i have a sheet "data entry" where multiple "item" names are entered, the range of "item" names can be millions, but in the attached sheet i have used only a few as an example.

    I need a macro to take all the "item" names from the "data entry" sheet and paste them into the "purchased by month" sheet under the relevant catagories with no duplicate "item" names.

    Then in the "avg per item purchased" sheet, i need the average of each of the items over only the months that have data.

    The data is currently only running up to column "z", but can go as far as column "xfd"

    hope i am explaining this clear enough.

    The data entered in red in the sheet is the desired results.

    Any help will be greatly appreciated.

    Thanks
    Attached Files Attached Files

  2. #2
    Forum Contributor ANDREAAS's Avatar
    Join Date
    05-06-2013
    Location
    Port Elizabeth, South Africa
    MS-Off Ver
    Excel 2007 / 2010
    Posts
    368

    Re: Search and list multiple names

    ............

  3. #3
    Forum Contributor ANDREAAS's Avatar
    Join Date
    05-06-2013
    Location
    Port Elizabeth, South Africa
    MS-Off Ver
    Excel 2007 / 2010
    Posts
    368

    Re: Search and list multiple names

    Bump - no reply

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Search and list multiple names

    Hi Andeaas, hoe gaan dit daar in die baai? (I grew up in PE, my old stamping grounds )

    I will take a look and see what see what I can come up with
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  5. #5
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Search and list multiple names

    Where is this data coming from?

  6. #6
    Forum Contributor ANDREAAS's Avatar
    Join Date
    05-06-2013
    Location
    Port Elizabeth, South Africa
    MS-Off Ver
    Excel 2007 / 2010
    Posts
    368

    Re: Search and list multiple names

    Hi

    lekker weer by die see

    hope you're well, and the kids...

    As ever any help is muuuuch appreciated, my dumbass still cannot get round all the code, even with all i've learned from the experts here (my heroes )

    thx dibbs.

  7. #7
    Forum Contributor ANDREAAS's Avatar
    Join Date
    05-06-2013
    Location
    Port Elizabeth, South Africa
    MS-Off Ver
    Excel 2007 / 2010
    Posts
    368

    Re: Search and list multiple names

    The data i have in there is mock data, but in the actual sheet it will be receipts captured by multiple persons.

    I have a lot of different buyers and currently they are cross - buying (one would buy 10 of an item, the other does not know and then buys the same), so what i'm trying to do is take the data that is already being captured and work out averages over a year for each item, then the buyers have an idea of how many of each item is needed per month and cn work together seeking out prices from their "contacts"

  8. #8
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Search and list multiple names

    My reason for asking where the data comes from, is because I was wondering if the data could be put into a better format/layout?

    Excel works best on 2D tables, would it be possible to get/put this data into something like that?
    Months across the top, items going down, with qty/item next to the item?

  9. #9
    Forum Contributor ANDREAAS's Avatar
    Join Date
    05-06-2013
    Location
    Port Elizabeth, South Africa
    MS-Off Ver
    Excel 2007 / 2010
    Posts
    368

    Re: Search and list multiple names

    In the actual workbook the are many more sheets that are linked to the data enrty, so i'd prefer to not change the format, but if that is the easiest way to get this done, then i suppose it will have to be. I will then just go and udjust the links of the other sheets....

  10. #10
    Forum Contributor ANDREAAS's Avatar
    Join Date
    05-06-2013
    Location
    Port Elizabeth, South Africa
    MS-Off Ver
    Excel 2007 / 2010
    Posts
    368

    Re: Search and list multiple names

    ................

  11. #11
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Search and list multiple names

    Sorry for not responding sooner

    You said that was a shortened version of your data. Did you shorten the material types, or categories or what? It might help to see a bigger sample?

  12. #12
    Forum Contributor ANDREAAS's Avatar
    Join Date
    05-06-2013
    Location
    Port Elizabeth, South Africa
    MS-Off Ver
    Excel 2007 / 2010
    Posts
    368

    Re: Search and list multiple names

    No problem at all, i am at your mercy .

    Shortened in the sense that there are less columns and rows, also it's not nuts and bolts, i just used this for an example file so as to not give away too much info of the business, in the attached example i entered "mock data" from grocery receipts, but the items can be anything from electronics to toilet paper in the actual workbook.

    The categories for each month would go to row 50 and the columns, depending on how much data is entered could go as far as column xfc

    see attached.
    Attached Files Attached Files

  13. #13
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Search and list multiple names

    So you would only ever have a max of 50 rows, but a ton of columns?

    If that is the case, would you consider transposing the table? (you have far more rows than columns, and we generally construct tables to grow downwards, rather than across)

  14. #14
    Forum Contributor ANDREAAS's Avatar
    Join Date
    05-06-2013
    Location
    Port Elizabeth, South Africa
    MS-Off Ver
    Excel 2007 / 2010
    Posts
    368

    Re: Search and list multiple names

    Yup, no problem. I'll just edit the links on the other sheets to adapt to the trnsposed data.

  15. #15
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Search and list multiple names

    What is the relationship btw categories and the items? (I have asked for extra help from the other senior members on this, too)

  16. #16
    Forum Contributor ANDREAAS's Avatar
    Join Date
    05-06-2013
    Location
    Port Elizabeth, South Africa
    MS-Off Ver
    Excel 2007 / 2010
    Posts
    368

    Re: Search and list multiple names

    Item is for instance "television 32" model1234" then it would be entered under the electronics category or if the item is "toothbrush" it'll fall under toiletries etc.

  17. #17
    Forum Contributor ANDREAAS's Avatar
    Join Date
    05-06-2013
    Location
    Port Elizabeth, South Africa
    MS-Off Ver
    Excel 2007 / 2010
    Posts
    368

    Re: Search and list multiple names

    By the way... Thanks for all the effort so far....and for calling in the cavalry

    i really do appreciate it.

  18. #18
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Search and list multiple names

    Quote Originally Posted by ANDREAAS View Post
    Item is for instance "television 32" model1234" then it would be entered under the electronics category or if the item is "toothbrush" it'll fall under toiletries etc.

    OK so there could be multiple items under 1 category?
    (geting late here, will pick up again tomorrow, and sorry this is taking forever)

  19. #19
    Forum Contributor ANDREAAS's Avatar
    Join Date
    05-06-2013
    Location
    Port Elizabeth, South Africa
    MS-Off Ver
    Excel 2007 / 2010
    Posts
    368

    Re: Search and list multiple names

    Correct, there can be a million different items under a catagory

    no problems, i'm just happy that someone is willing to help

  20. #20
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Search and list multiple names

    This is kinda what I am working towards, take a look and see if this is something you can work with?

    I created a new sheet (Sheet2) which would replace your Data Entry sheet - simple, straightforward data entry method. There is some repeating (dates), but this can be overcome using a small formula)

    I added some dummy data, and have started on your Usage sheet
    Attached Files Attached Files

  21. #21
    Forum Contributor ANDREAAS's Avatar
    Join Date
    05-06-2013
    Location
    Port Elizabeth, South Africa
    MS-Off Ver
    Excel 2007 / 2010
    Posts
    368

    Re: Search and list multiple names

    GREAT!

    ONLY IN "USAGE" COLUMN "B" THE TIMES THAT THE ITEM IS ENTERED FOR THAT MONTH MUST BE CALCULATED. I USED THIS
    Please Login or Register  to view this content.
    THIS IS AWESOME! THANK YOU VERY MUCH FOR ALL THE TIME AND EFFORT YOU PUT INTO THIS SO FAR. YOU ROCK!

    ALL I NEED NOW IS ANOTHER SHEET WHERE THE AVERAGE TIMES EACH ITEM COMES UP OVER THE MONTH THERE ARE DATA ENTERED FOR I.E. IF THE ITEM "ERTJIES 250G" SHOWS A 6 IN THE USAGE SHEET IN COLUMN B WITH THE ABOVE FORMULA APPLIED UNDER FEBRUARY AND A 2 UNDER MARCH THE AVERAGE IS 4 AND SO ON FOR EACH ITEM, BUT ONLY FOR THE MONTHS THAT ACTUALLY HAVE DATA ENTERED.

  22. #22
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Search and list multiple names

    For the average, you would use something like this...
    =IF(B3="","",AVERAGEIFS(Sheet2!$C:$C,Sheet2!$B:$B,Usage!B$2,Sheet2!$D:$D,Usage!B3))

  23. #23
    Forum Expert
    Join Date
    08-02-2013
    Location
    Québec
    MS-Off Ver
    Excel 2003, 2007, 2013
    Posts
    1,414

    Re: Search and list multiple names

    Hi,

    See if this code can help you. It's using a Dictionary of Dictionaries.
    It's not complete because it only compiles the February data but it should get you started. What it does is take the data for February and outputs it to a new sheet called Output.

    By adding a loop you could go through each month in the "Data entry" sheet and compile the results.

    Please Login or Register  to view this content.
    Attached Files Attached Files
    GC Excel

    If this post helps, then click the star icon (*) in the bottom left-hand corner of my post to Add reputation.

+ 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. Search a range Last Names for age & return the value to a List of FULL NAMES
    By LunarLights in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-16-2014, 05:02 PM
  2. [SOLVED] Search a list of names and automatically return any names not already included in table
    By bishbash89 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 02-21-2013, 09:06 AM
  3. Search Multiple Worksheets Against List of Non-Exact Search Criteria?
    By thump4r in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-17-2010, 03:46 PM
  4. Search and Copy files from a list of file names excel vba programming
    By aashishnawal in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-21-2010, 09:27 AM
  5. how do I search a word or pdf for a list of names in a CSV file?
    By Martin Crane in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-30-2008, 05:16 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