+ Reply to Thread
Results 1 to 17 of 17

VLookup or maybe something completely different??

  1. #1
    Registered User
    Join Date
    11-29-2010
    Location
    University Park, IL
    MS-Off Ver
    Excel 2010
    Posts
    11

    VLookup or maybe something completely different??

    Hi- I am not even sure if this was the correct category to post the question, but I have such a specific thing I am trying to do that I am really having an impossible time trying to google it and find answers in this forum.

    Below, I try to describe the situation and give a generic example- please let me know what information is missing or how I can better explain what I am hoping to do.

    Here's my situation: I have two different spreadsheets and I need to somehow find all the numbers in the first spreadsheet in the second. Basically I have a list of ID numbers that are all associated with one code. What complicates the matter is that any given ID number can also be associated with several other codes. So, I have a spreadsheet that solely has the list of ID #'s that were associated with just the one code, and then I have a master spreadsheet that lists every single ID number (even those without any association to the first code), and for each time the ID number is associated with a new code, it has a new row in the spreadsheet.

    Ultimately, I would like to somehow filter the master spreadsheet so that it only has the ID numbers from the "one code" spreadsheet, BUT keeps all rows associated with that particular ID number- in other words, I am able to see all of the various codes associated with those ID numbers. Does that make sense at all?

    So, to give a practical example (in case it helps), let's say that I run my own doctor's office. Each patient has their own unique ID number in the system. Throughout the year, that person has many different treatments- one time they come because they need a prescription, another time it's just their annual check-up and another time let's say that they sprained their ankle. My first spreadsheet simply tells me any patient that got a prescription- let's say there are 50. It only has the list of ID's (in a column) for those patients that have gotten a prescription.

    My master list, on the other hand, includes every single patient I have ever had, and the layout is such that one patient has as many rows as they have had different treatments. So the person described above has 3 total rows, each of the three has the patient's ID # in Column A, then in Column B, one row says prescription, the 2nd row says annual visit and the 3rd row as ankle sprain.

    Ultimately, I want to be able to filter that master list and somehow (hopefully) copy the column that lists the 50 patient ID's from the first spreadsheet (representing those patients that have needed a prescription) and somehow (no clue as to how) filter the master spreadsheet so that I am left with the pool of 50 patients, but now I can see every single treatment they have come in for, in addition to needing a prescription.

    does that make any sense at all??? Anyone? Bueller? The spreadsheets I am actually working with have over 500 rows and I do this weekly so I just cannot be dedicating 6 hours each week to manually match each ID number- I'd go crazy!!

    Thanks so much for the help!
    Last edited by jgoins; 11-30-2010 at 06:18 PM. Reason: Marking as SOLVED

  2. #2
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: VLookup or maybe something completely different??

    as an option you can use pivot table to create report on patients. It is nice to have sample of your data at hand

  3. #3
    Registered User
    Join Date
    11-29-2010
    Location
    University Park, IL
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: VLookup or maybe something completely different??

    Quote Originally Posted by watersev View Post
    as an option you can use pivot table to create report on patients. It is nice to have sample of your data at hand
    Is that something that I should email you? I can definitely send you something a sample of the data right now if that would help?

  4. #4
    Forum Contributor 00Able's Avatar
    Join Date
    11-17-2010
    Location
    Pittsburgh, PA
    MS-Off Ver
    Excel 2003, 2007, 2010
    Posts
    244

    Re: VLookup or maybe something completely different??

    You should attach it to this thread, remember, this is a public forum so be sure to take out any personal content, and also remember, at any time you can remove a file once you post. However keep in mind once a user uploads it, they already have the content in their posession.
    Last edited by 00Able; 11-29-2010 at 05:23 PM.

  5. #5
    Registered User
    Join Date
    11-29-2010
    Location
    University Park, IL
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: VLookup or maybe something completely different??

    Quote Originally Posted by 00Able View Post
    You should attach it to this thread, remember, this is a public forum so be sure to take out any personal content, and also remember, at any time you can remove a file once you post. However keep in mind once a user uploads it, they already have the content in their posession.
    ok I will right now. Thanks- just give me a sec

  6. #6
    Registered User
    Join Date
    11-29-2010
    Location
    University Park, IL
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: VLookup or maybe something completely different??

    Ok here's the two spreadsheets in one workbook
    Attached Files Attached Files

  7. #7
    Forum Contributor 00Able's Avatar
    Join Date
    11-17-2010
    Location
    Pittsburgh, PA
    MS-Off Ver
    Excel 2003, 2007, 2010
    Posts
    244

    Re: VLookup or maybe something completely different??

    Yep, easy fix...index match or vlookup, my preference is index match, gimme a minute...

  8. #8
    Forum Contributor 00Able's Avatar
    Join Date
    11-17-2010
    Location
    Pittsburgh, PA
    MS-Off Ver
    Excel 2003, 2007, 2010
    Posts
    244

    Re: VLookup or maybe something completely different??

    Ok, See third sheet in your workbook, if you need more rows, just copy paste

    Hope this helps


    Please consider:
    Cleaning up when you're done. Mark your thread [SOLVED] if you received your answer.
    Thanking those who helped you. Click the scales icon (Reputation) in the upper right corner of the contributor's post.
    Last edited by 00Able; 12-05-2010 at 07:29 PM.

  9. #9
    Registered User
    Join Date
    11-29-2010
    Location
    University Park, IL
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: VLookup or maybe something completely different??

    Ok you are clearly very very smart, so I am going to ask if something slightly different is possible- Again, I am sorry for being so terrible at explaining this stuff.

    Using the workbook that you attached with the 3rd tab, if you look at ID#671802239 for example, it is on the first tab (Code Trg only) and then on the master, we can see that it has 2 rows (A200 and A201).

    So, what I am ideally looking for is to either have a 3rd tab (like you created) that pulls those 2 rows out or to simply filter the master spreadsheet so that I would see both rows for ID#671802239- and then of course, in the end, I want to be able to generate that for the entire list, not just one ID# at a time.

    Do you know if that is possible?? Thanks- I do really appreciate your help!!

  10. #10
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: VLookup or maybe something completely different??

    hope I got your idea.

    Open file, [Alt+F8], run macros "filtering".
    Attached Files Attached Files

  11. #11
    Forum Contributor 00Able's Avatar
    Join Date
    11-17-2010
    Location
    Pittsburgh, PA
    MS-Off Ver
    Excel 2003, 2007, 2010
    Posts
    244

    Re: VLookup or maybe something completely different??

    I came up with a couple of alternative methods, but watersev's file, is the better than anything I can put together. Great Macro watersev, think I am gonna keep that one handy.

  12. #12
    Registered User
    Join Date
    11-29-2010
    Location
    University Park, IL
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: VLookup or maybe something completely different??

    Quote Originally Posted by watersev View Post
    hope I got your idea.

    Open file, [Alt+F8], run macros "filtering".
    AHH!!!! THAT IS PERFECT!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! You are a friggin rock star.

    Is that something that I can use over and over again? So for example, if I run a report weekly, do I just need to paste the new info into the current tabs and it will work? (I am so sorry if my ignorance is annoying- I must sound like a toddler right now because of how inept I am with this stuff!)

  13. #13
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: VLookup or maybe something completely different??

    that's right, it can be used with new data of the same structure

  14. #14
    Registered User
    Join Date
    11-29-2010
    Location
    University Park, IL
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: VLookup or maybe something completely different??

    That is so fantastic- thank you so much!!!

  15. #15
    Registered User
    Join Date
    11-29-2010
    Location
    University Park, IL
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: VLookup or maybe something completely different??

    Quote Originally Posted by 00Able View Post
    Ok, See third sheet in your workbook, if you need more rows, just copy paste

    Hope this helps


    Please consider:
    Cleaning up when you're done. Mark your thread [SOLVED] if you received your answer.
    Thanking those who helped you. Click the scales icon (Reputation) in the upper right corner of the contributor's post.
    ---can you tell me how to mark this thread as "Solved"

    Thank you again!

  16. #16
    Registered User
    Join Date
    11-13-2010
    Location
    Springfield, IL
    MS-Off Ver
    Excel 2007
    Posts
    36

    Re: VLookup or maybe something completely different??

    To mark as solve, just go up to your first post at the top of the thread, click the edit button. When the text becomes edittable, there will also be a button in the lower right corner that says, "Go Advanced". When you click that, your post becomes fully editable like it was when you typed it up originally. In the top left corner, next to the title, will be a drop down box. Select "Solved."

  17. #17
    Forum Contributor 00Able's Avatar
    Join Date
    11-17-2010
    Location
    Pittsburgh, PA
    MS-Off Ver
    Excel 2003, 2007, 2010
    Posts
    244
    I think macro will come in handy for alot of different things.
    Last edited by 00Able; 11-30-2010 at 05:02 PM.

+ 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