+ Reply to Thread
Results 1 to 8 of 8

VLOOKUP gives Mixed Results

  1. #1
    Registered User
    Join Date
    12-17-2014
    Location
    Florida
    MS-Off Ver
    Microsoft for Mac 2008 v12.3.6
    Posts
    6

    VLOOKUP gives Mixed Results

    Need help with setting up two main formulas. First one is for cells I11 to I27 and then repeated at K11 to K27, M11 to M27, O11 to O27, etc all the way up to AY11 to AY27. The present formula I am using works only part of the time and I think there must be some type of syntax error. The formula is as follows =IF(ISNA(VLOOKUP(I$39,$L9:$S9,2,FALSE)),"",VLOOKUP(I$39,$L9:$S9,2,FALSE))

    First, it is suppose to check cell I39 for the year and go to the Lookup table. I have tried VLOOKUP, HLOOKUP, MATCH, LOOKUP, etc but all have the same problem……they get some cell values correct but not all . Using VLOOKUP I wanted to check the date and if it matches then transfer the value from the next cell to the right (position2) to the matching cells below. If no match , then no entry. The problem starts because many of the cells do not get transferred. I believe it is a result of the way I have written the formula…..the problems get worse after year 2020 (column S)

    You will note that the interval time cycle for each event is different …..maybe yearly all the way to every 20 years so there is a wide range of values. It seems like the formula is looking for only a match with the first desired value. Example if you open the spread sheet , you will note that many cells are highlighted with “yellow”. These are cells where the formula did not work. At cell W42 , the formula should have gone to the lookup table and looked for 2022 and since there is a 2022 in cell N10 , should have then transferred the value of -4009 into cell W42.

    The second formula does not exist but you can see the logic on the spreadsheet. Col. H cells H41 to H56 need to look to the right and find the first intersecting value. For cell H11 it should look down row 11 and then see -4026 at cell Q11. Then it should take that value (-4026) and divide it by the number of years shown in column F, cells F11 to F26. And then take that value and put it in all of the cells preceding the -4026. So the value of -805 should be shown in cells J11 - L11 – N11 - P11

    I put a second set of completed cells below the "problem area" to show what the completed document should look like.....done manually.

    Looking for any help I can get

    Thanks
    Last edited by wallyclan; 12-20-2014 at 08:05 AM. Reason: forgot to include attachment

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,002

    Re: VLOOKUP gives Mixed Results

    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  3. #3
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,498

    Re: VLOOKUP gives Mixed Results

    as Glenn noted posting a sample will go a long way toward getting the appropriate answer.
    However from what I see in this formula =IF(ISNA(VLOOKUP(I$39,$L9:$S9,2,FALSE)),"",VLOOKUP(I$39,$L9:$S9,2,FALSE)) is that you are saying to look at the value in I39 and go to see if it is in L9 and if it is go over to M9 (the 2 part of the formula) and return that value. I don't know why you have it going from L9:S9 since anything past M9 is irrelevant to the formula - just a thought.
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

  4. #4
    Registered User
    Join Date
    12-17-2014
    Location
    Florida
    MS-Off Ver
    Microsoft for Mac 2008 v12.3.6
    Posts
    6

    Re: VLOOKUP gives Mixed Results

    Hi and thanks, still trying to upload the file. Says it's an invalid file....I don't think so but I will try another format and rename it.

  5. #5
    Registered User
    Join Date
    12-17-2014
    Location
    Florida
    MS-Off Ver
    Microsoft for Mac 2008 v12.3.6
    Posts
    6

    Re: VLOOKUP gives Mixed Results

    Attaching the file so you can see where the problems are.
    Attached Files Attached Files

  6. #6
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: VLOOKUP gives Mixed Results

    shouldnt it be
    =VLOOKUP(I$39,$L9:$S24,2,FALSE)
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  7. #7
    Registered User
    Join Date
    12-17-2014
    Location
    Florida
    MS-Off Ver
    Microsoft for Mac 2008 v12.3.6
    Posts
    6

    Re: VLOOKUP gives Mixed Results

    My thought was that when I do the fill down in each column the Lx:Sx would follow the appropriate line. I didn't want to make the formula "get confused" truing to match a given date (i.e. 2028) from all over the selection down to S24 when I only care about transferring the values that are on the same line, example for cell O41, I wanted to lookup 2019 from cell O39 and go to the lookup table and go across to enter any value one cell to the right if it saw 2019. This works. You will see in the lookup table on line L9:S9 that the other "matches" there are for years 2024 - 2029 and 2034. The problem is that when I want the values next to those years to go down into the "body" of the document and it doesn't happen.
    I hope I haven't confused you

  8. #8
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,498

    Re: VLOOKUP gives Mixed Results

    In my experience lookup can work when values are in ascending order and not so good when the values are out of sequence. Vlookups on the other hand don't float looking for their values. If you tell it to start looking in cell L9 it will look for the in L9 and if it is in M9 instead it will not find it. Have you tried Martin's formula?

+ 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. Replies: 6
    Last Post: 11-17-2015, 10:11 AM
  2. [SOLVED] Vlookup giving mixed results on same dataset
    By TexasKersh in forum Excel General
    Replies: 3
    Last Post: 08-04-2014, 11:46 AM
  3. Replies: 1
    Last Post: 05-07-2013, 07:58 AM
  4. Macro activated from multiple sheets causing mixed results
    By Beau Burton in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-21-2012, 11:59 PM
  5. I mixed , help me in VLOOKUP()
    By 3Dmajid in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-11-2008, 06:40 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