+ Reply to Thread
Results 1 to 11 of 11

Vlookup of a number then offset function to get data from next row down 4th column over

  1. #1
    Registered User
    Join Date
    10-02-2012
    Location
    cs
    MS-Off Ver
    Excel 2003
    Posts
    17

    Talking Vlookup of a number then offset function to get data from next row down 4th column over

    The object here is to input a Measure Depth (MD) and have it calculate a Total Vertical Depth (TVD). All the calculations for that are completed, just struggling with the following:

    I have this array of information (A1:H9). To determine the TVD of any (MD), I need to find the two surveys (Column A) that are smaller and larger than the MD asked for.

    So I key in a MD and have a cell that has a VLOOKUP function that will return the survey that is less than the depth asked for (completed). In order to get the second survey, one that is greater than the depth asked for, I need to add the CL (length between surveys(Column D)) to the value of data from the Vlookup. (or is there an equation that finds the "greater than" survey depth of the Measure Depth asked for?

    So, the CL I need will always be (1) row down and (4) columns to the right of the value found from the Vlookup (column D). I think the formula should be something like the two below, however, neither works.

    OFFSET(VLOOKUP(input Cell,A1:H9,1,true))(A1:H9,1,4)
    or
    and(OFFSET(VLOOKUP(Any Cel,A1:H9,1,true))(A1:H9,1,4)

    Measured
    Depth
    Survey Inc Azm CL TVD VS N/S E/W

    A B C D E F G H
    Survey Inc Azm CL TVD VS N/S E/W
    17777 88.53 359.77 31 10949.63 7114 7099 -494
    17840 88.44 0.38 63 10951.29 7177 7162 -493
    17885 89.67 0.74 45 10952.04 7222 7207 -493
    17935 91.52 1.44 50 10951.52 7272 7257 -492
    18001 90.42 0.82 66 10950.40 7338 7323 -491
    18031 89.41 0.65 30 10950.44 7368 7353 -490
    18061 88.57 0.21 30 10950.97 7398 7383 -490
    18092 88.53 0.03 31 10951.76 7429 7414 -490
    18123 88.84 0.74 31 10952.47 7460 7445 -490

    So if I create a cell where I enter a MD say "18002" the following two depths and data need to be returned:

    Depth MD Inc Azm CL TVD VS N/S E/W
    18001 90.42 0.82 66 10950.40 7338 7323 -491 (already have a Vlookup that gives me this)
    18031 89.41 0.65 30 10950.44 7368 7353 -490 (Need function to return this MD)


    I figure the easiest way to get the "greater than" survey depth (18031) is to add the Course Length (CL) (Column D) to the "smaller than" survey (18001). This info always falls one row down and 4 columns to the right of the "less than" survey value.

    Either my syntax is off or I am looking at this wrong. HELP!

  2. #2
    Forum Expert ConneXionLost's Avatar
    Join Date
    03-11-2009
    Location
    Victoria, Canada
    MS-Off Ver
    2010
    Posts
    2,952

    Re: Vlookup of a number then offset function to get data from next row down 4th column ove

    You could try:

    Please Login or Register  to view this content.
    and

    Please Login or Register  to view this content.
    Would you like to say thanks? Please click the: " Add Reputation" button, on the grey bar below the post.

  3. #3
    Registered User
    Join Date
    10-02-2012
    Location
    cs
    MS-Off Ver
    Excel 2003
    Posts
    17

    Re: Vlookup of a number then offset function to get data from next row down 4th column ove

    Wow, quick response, thank you. However, both of these gives me an error of "You've entered too many arguments for this function", that is what I was getting when I was trying my formula.

  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
    52,936

    Re: Vlookup of a number then offset function to get data from next row down 4th column ove

    did you use "input cell" in the formulas, or did you use a reference to where your actual input cell is?
    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
    Registered User
    Join Date
    10-02-2012
    Location
    cs
    MS-Off Ver
    Excel 2003
    Posts
    17

    Re: Vlookup of a number then offset function to get data from next row down 4th column ove

    Belay that last, paren issue. But it gives me #N/A

  6. #6
    Registered User
    Join Date
    10-02-2012
    Location
    cs
    MS-Off Ver
    Excel 2003
    Posts
    17

    Re: Vlookup of a number then offset function to get data from next row down 4th column ove

    I did put the reference to the cell I am using.

  7. #7
    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
    52,936

    Re: Vlookup of a number then offset function to get data from next row down 4th column ove

    upload a sample workbook for us to look at

  8. #8
    Registered User
    Join Date
    10-02-2012
    Location
    cs
    MS-Off Ver
    Excel 2003
    Posts
    17

    Re: Vlookup of a number then offset function to get data from next row down 4th column ove

    This is eventually going to reference another sheet, but attached file is what I am doing.

    I think the key here is that no matter what measured depth (MD)I put into A71, in column A (survey depth) the function needs to grab the survey "Less Than" and the survey depth "Greater Than" A71 for the other formulas to work. This will always change as we drill ahead so it needs to reference an ever changing "Greater Than" and "Less Than survey depth.

    All these equations I did and I can't figure out how to get this aspect, totally pisses me off.

    One other note, the CL in column D is the course length between surveys. So column D in the "Greater Than" survey has the distance from the "Less Than" survey. My initial thought was to find the "Greater Than" survey depth, get the CL from column D and add it to the depth of the "Less Than" survey. But I bet there is an easier way. Technically if we could do a Vlookup that would find the "Greater Than" survey that would solve our problem. I cannot seem to find a function that will do that.

    Look at attached and let me know if you have any questions.
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    10-02-2012
    Location
    cs
    MS-Off Ver
    Excel 2003
    Posts
    17

    Re: Vlookup of a number then offset function to get data from next row down 4th column ove

    Any ideas on this problem? I attached a file on my last thread.

  10. #10
    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
    52,936

    Re: Vlookup of a number then offset function to get data from next row down 4th column ove

    to get the "less than" part, try this
    =INDEX($A$60:$H$68,MATCH($A$71,A60:A68)-1,1)

    to get the "greater than" part, try this
    =INDEX($A$60:$H$68,MATCH($A$71+1,A60:A68,1)+1,1)

  11. #11
    Registered User
    Join Date
    10-02-2012
    Location
    cs
    MS-Off Ver
    Excel 2003
    Posts
    17

    Re: Vlookup of a number then offset function to get data from next row down 4th column ove

    Brilliant, thank you so much. I am impressed by the fast response on this site.

    Thank you again. Is there anything I can do for you?

  12. #12
    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
    52,936

    Re: Vlookup of a number then offset function to get data from next row down 4th column ove

    we aim to please
    just mark this post "solved", and maybe consider thanking those who helped you (see 2&3 below)

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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