+ Reply to Thread
Results 1 to 24 of 24

Continue Searching a table with Vlookup despite finding one match

  1. #1
    Registered User
    Join Date
    06-19-2008
    Posts
    34

    Continue Searching a table with Vlookup despite finding one match

    Im using vlookup to search a table and fill out a calendar with dates that various employees are gone. They can have multiple trips in one month and thus will be in the table multiple times. I have the calendar set up so days go across the top and names go along hte left side. so each cell is identified by name and day. I then have each cell using the vlookup command to search the table. now if one person has multiple trips a month is there a way to compare multiple entries in the table?

  2. #2
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591
    Hi

    1) Is a person likely to have more than 1 trip in a day?
    2) What do you want to appear in the intersect cell of the name / date? A number, a "y" or something else.

    Also, can you attach an example file of your situation so we can tailor a response to your structure.

    rylo

  3. #3
    Registered User
    Join Date
    06-19-2008
    Posts
    34
    Answers to your question
    1) A person can only have one trip a day, but multiple trips a month/year.

    2) I have the region showing in the cell if a person is on a trip then. Then conditional formatting changes the font and background to the same colors to match the key.

    I cant make a sample sheet, i tried just copying small parts of my sheet but it wasnt working. So here is the formula from the cells
    Please Login or Register  to view this content.
    Its really nasty. if you want i can email the entire thing to you, but the zipped file is massive and i cant connect it to this forum

    thanks
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    06-19-2008
    Posts
    34
    So,
    ive done a bit of work and made the formula more simple. Which has made the file much smaller. Here it is
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    06-19-2008
    Posts
    34

    Vlookup w/ multiple references

    Hey does anyoen know if there is a vlookup similiar function that will look using multiple reference, say a name and date. In my example Name and Begin Day is used to find region.
    Thanks
    Attached Files Attached Files

  6. #6
    Forum Contributor
    Join Date
    10-17-2007
    Location
    Washington, DC
    Posts
    103
    I can not follow your excel file to see what you are trying to do...

    But to do a vlookup with multiple columns, use the concatenate function then vlookup on the resulting data

  7. #7
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591
    Hi

    Can you pick a couple of Names, on that does match and one that doesn't and explain what should happen for both these items. Give us the actual output, and the why - don't try to give formulas.

    rylo

  8. #8
    Registered User
    Join Date
    06-19-2008
    Posts
    34
    So heres a little explaination of my excel sheet.

    For Ives, Ed if you go to the background you see there are two trips scheduled for him. one from 7/2 to 7/4 and another from 7/28 to 8/3. The way it should work is that both trips would show up on the Calendar sheet. However, right now only one trip is showing up on the calendar. It is pretty simple to deduce why though, the vlookup function uses a serial search to find your reference in the table. Once it is found it exits the search.

    So what im trying to do is to continue searching if the date found with the name does not fit the date on the calendar.

    Hope that helps
    Thanks
    Dlroo

  9. #9
    Registered User
    Join Date
    06-19-2008
    Posts
    34
    psumvp
    ive tried working out the concatenate function you mentioned, but in the process I realized that it probably wouldnt work without alot of extra work and space. The trips i have in my table are denoted with an end day and a begin day so to use the & function i would have to do a seperate column on the table for each day of the trip. its a great idea and i can see how it would work but its not the right idea for my situation. thank you for it though.

  10. #10
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591
    dlroo

    This only a start, but may get you going.

    1) C6: =SUMPRODUCT(--(Background!$A$2:$A$7=Calendar!$A6),--(Background!$F$2:$F$7=Calendar!$B6),--(Background!$G$2:$G$7<=DATEVALUE(C$5&$I$2&$C$2)),--(Background!$H$2:$H$7>=DATEVALUE(C$5&$I$2&$C$2)))
    2) Put your cursor in C6, then format, conditional formatting, cell value is: greater than or equal to: 1, then enter your format.
    3) copy down across as required.

    If this is giving the right information, then you could turn off the cell formatting and perhaps use an event macro to color those cells that were non zero with the color scheme that is relevant for the job/region.

    rylo

  11. #11
    Registered User
    Join Date
    06-19-2008
    Posts
    34
    Rylo, I dont really follow what you have there, is it zero wehn the date doesnt show and non zero when the date is in the list?
    Thanks
    Dlroo

  12. #12
    Registered User
    Join Date
    06-19-2008
    Posts
    34
    Would using Index work? I dont really understand the function, does it return a value using multiple references?

  13. #13
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320
    sheet 1 is same as your background
    2nd sheet"lookup" would have to have an array for each person
    i did one for ives,ed
    it returns where he's going and between which 2 dates which you should then be able to use in your calendar
    not sure how but dates should be unique as he can only be in one place at a time probably using index/match in each day in the ives,ed row of the calender to find that date against the range CO62:CQ110
    then again i'm lost it seemed like a good idea at the time!
    there is also a bit in j and k to get rid of dates if not booked
    these are the values returned on "lookup"
    .....
    anyone else fancy a go getting that into the cells?
    Attached Files Attached Files
    Last edited by martindwilson; 07-08-2008 at 02:38 PM.

  14. #14
    Registered User
    Join Date
    06-19-2008
    Posts
    34
    So I should create another sheet with multiple tables. Each table refers to one person and contains all there trips. and then in the calendar sheet i lookup the people with regards to their respective trips. that will probably work. Ill work on it and get back to you

  15. #15
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320
    no ,there should be sufficient room on look up sheet for each person up to 500 rows any more and youd have to adjust all the 500's in the formula to match
    just its alot of work to fill all the arrays in! you dont want 60 tabs
    you should just be able to enter each person as required in "background"
    try adding anothe appointment for ives,ed you should see how it works
    adjust the array formulas to match each name(for ed.ives you will see $CO$61 the cell his name is in,
    in the array thats the bit to change)
    also for the first lot at top of sheet adjust formulas so the bit
    ROW()-61 reads ROW()-1 at begining and end of formula(youll see it matches the row number of the reference cell)
    once formula is in cell confirm with ctrl+shift+enter then drag it down i allowed for around 60 rows
    you could insert more
    Last edited by martindwilson; 07-08-2008 at 03:23 PM.

  16. #16
    Registered User
    Join Date
    06-19-2008
    Posts
    34
    I was just gonna make one sheet so that it was cleaner.

  17. #17
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320
    oops correction ,
    there should be sufficient room on look up sheet for each person up to 500 rows
    should say

    "sufficient room on background sheet for each person 's appointments up to 500 rows"


  18. #18
    Registered User
    Join Date
    06-19-2008
    Posts
    34
    Martin,
    So i have the individual persons table set up. How do i fill the calendar now. i cant really use a vlookup because if the date falls inbetween the begin and end date it wont register in the vlookup.
    Again,
    Thanks for the help

  19. #19
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320
    unfortunately i havent worked that out!yet
    you have the start and end dates
    so it should be able to populate/shade cells based on that info
    might have to add a flag so it only goes from one start to next end else it will shade all cells between any date.
    ill give it some thought

    any one else know how this could be done?

  20. #20
    Registered User
    Join Date
    06-19-2008
    Posts
    34
    What i had been doing was using vlookup to find the person in the background sheet and then checking to see if the date fell in between the range of dates. the only problem with that was that it would only populate the first trip. now the problem is i do not know what to reference if i were to use a vlookup. If i do a vlookup with a range (approximate) it would register a trip when there wasnt one.

  21. #21
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320
    ok ive pulled start and end into calendar using match(see tab)
    now you need to format cells so it colours in between those numbers taking into account americas,europe ect, i think this can be done in excel 2003 or higher.
    i pulled ed ives name from o61
    this is getting a tad harder as you'd have to repeat formula for each name
    and 2 you have to account for when appointment runs accros a month in the formatting
    Attached Files Attached Files

  22. #22
    Registered User
    Join Date
    06-19-2008
    Posts
    34
    The problem with the spanning months is why i was using a vlookup and boolean >= start and <= end but then the problem arose with only one entry per person.

  23. #23
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320
    i supose you could cheat and put whole year on a sheet
    then create 12 monthly sheets referencing the year sheet
    with a bit of vba to copy formats

  24. #24
    Registered User
    Join Date
    06-24-2008
    Posts
    2

    Similar scheduling problems

    Related scheduling problems are discussed in the new text "Excel Basics" ( all the books you need )
    Last edited by Simon Lloyd; 07-15-2008 at 04:28 AM.

+ 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