+ Reply to Thread
Results 1 to 11 of 11

Hlookup + Vlookup

  1. #1
    Forum Contributor
    Join Date
    04-26-2017
    Location
    Brussels, Belgium
    MS-Off Ver
    2010
    Posts
    133

    Question Hlookup + Vlookup

    Hello,

    i'm new to this forum because I would like to improve my MS Excel skill.

    I already have a first challenge that I'd like to accomplish..
    This is the situation.. I have a lookup table in the range X50-AK60:

    lookup-column.png

    I have two variables O38 (starting thickness) and O41 (length)

    lookup-vars.png

    This is what I want to achieve:
    1) Find value O38 in the range X52 - AK52
    ex. 120 mm => AB52
    2) Then find the corresponding value two rows higher in row 50
    ex. AB52 => AB50 = 6 m
    3) Add value O41 to the corresponding value in row 50 and detirmine the new corresponding field in row 50
    ex. AB50 = 6 m + 10,8 m = 16,8 m (= AK50)
    4) Then find the corresponding value two rows lower in row 52
    ex. AK52 = 300 mm

    listup.png

    I tried a combination of INDEX and MATCH functions to the the wanted value, but I don't get the right value..
    The combination of all these steps is confusing for my basic excel knowledge.
    Can anyone help me?
    Last edited by Solvax; 04-26-2017 at 05:59 PM. Reason: Added image

  2. #2
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Office 365
    Posts
    3,937

    Re: Hlookup + Vlookup

    Welcome to Excel Forum,
    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 then scroll down to Manage Attachments to open the upload window.
    If I helped, Don't forget to add reputation (click on the little star ★ at bottom of this post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)

  3. #3
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,732

    Re: Hlookup + Vlookup

    It is not clear from your pictures if the values are pure numbers to which the units have been added by custom formatting, or if you have typed the units in along with the values (thus making them text values). It would help if you attached a sample Excel workbook.

    To do this, click on Go Advanced (below the Edit Window) while you are composing a reply, then scroll down to and click on Manage Attachments and the Upload window will open. Click on Browse and navigate to (and double-click) the file icon that you want to attach, then click on Upload and then on Close this Window to return to the Edit window. When you have finished composing your post, click on Submit Post.

    Please note that the Paperclip icon does not work.

    Hope this helps.

    Pete

  4. #4
    Forum Contributor
    Join Date
    04-26-2017
    Location
    Brussels, Belgium
    MS-Off Ver
    2010
    Posts
    133

    Re: Hlookup + Vlookup

    Thank you Shukla, please find attached the excel file (simplified with different cells)
    Attached Files Attached Files

  5. #5
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Office 365
    Posts
    3,937

    Re: Hlookup + Vlookup

    Try in sheet After

    C7
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  6. #6
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,732

    Re: Hlookup + Vlookup

    You will need to change the entries in B5 and B6 so that they are pure numbers - use the format painter icon to apply the same custom format from G8 to B5 and from G6 to B6, then enter 120 in B5 and 10.8 in B6 (though you would enter it as 10,8), and then you can use this formula in B7:

    =IFERROR(HLOOKUP(INDEX(G6:T6,MATCH(B5,G8:T8,0))+B6,G6:T8,3,0),"")

    Hope this helps.

    Pete

  7. #7
    Forum Contributor
    Join Date
    04-26-2017
    Location
    Brussels, Belgium
    MS-Off Ver
    2010
    Posts
    133

    Re: Hlookup + Vlookup

    Hi everyone,

    thank you for the great help.

    I have tried Pete's formula since this is the easiest for me to understand.
    =IFERROR(HLOOKUP(INDEX(G6:T6,MATCH(B5,G8:T8,0))+B6,G6:T8,3,0),"")

    This formula works when I have the value 120 in B5.

    However when I change the value in B5 to for example 100 it doesn't find a value..
    =IFERROR(HLOOKUP(INDEX(G6:T6,MATCH(B5,G8:T8,0))+B6,G6:T8,3,0),"")
    Only when I change this to TRUE, it comes up with the requested value..
    Very strange because these are exact values in the table that can be found when entering 100 in B5..

    Can anyone advise me on this matter?
    Last edited by Solvax; 04-26-2017 at 07:07 AM.

  8. #8
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,732

    Re: Hlookup + Vlookup

    This is probably because some decimal fractional values cannot be represented with complete accuracy in the binary system which computers use. Fractional values in binary are representations of repeated division by 2, so although 0.5 can be represented exactly, it turns out that 0.1 and other simple decimal fractions are recurring values in binary, and thus have some inherent error built in (in the same way that 0.666 and 0.667 in decimal are NOT completely accurate representations of the fraction 2/3.

    Thus, when two fractions are added together, this small error in each can build up so that an exact match is not found when using 0 (or FALSE) as the last parameter in a MATCH or HLOOKUP function. By changing the formula to this:

    =IFERROR(HLOOKUP(INDEX(G6:T6,MATCH(B5,G8:T8))+B6,G6:T8,3),"")

    (as the TRUE parameter is assumed, if omitted), then it should work more consistently.

    Hope this helps.

    Pete

  9. #9
    Forum Contributor
    Join Date
    04-26-2017
    Location
    Brussels, Belgium
    MS-Off Ver
    2010
    Posts
    133

    Re: Hlookup + Vlookup

    Thank you Pete.. works like a charm

  10. #10
    Registered User
    Join Date
    05-05-2017
    Location
    Bradenton, FL
    MS-Off Ver
    2013
    Posts
    4

    Re: Hlookup + Vlookup

    hi pete, I have question about your post when Cell value are pure numbers, with formatting applied to then does excel perform calculation using pure numbers or the formatted value?

  11. #11
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,732

    Re: Hlookup + Vlookup

    You shouldn't really post a question in someone else's thread (read Forum Rule 02) - instead, you should start your own thread, referring back to this one if necessary.

    However, just to answer your query, formatting does not change the underlying value of a cell, so if you apply a Custom Format to a cell and then do some arithmetic on it, it will be the value in the cell that is used in the calculation.

    Hope this helps.

    Pete

+ 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. vlookup/hlookup, or what?
    By spectral75 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 06-10-2016, 10:21 AM
  2. Vlookup and Hlookup tutoring help
    By qabzib7 in forum Excel General
    Replies: 1
    Last Post: 04-16-2015, 05:45 PM
  3. Using a Vlookup with a Hlookup(maybe)
    By johnny5dime in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 05-29-2014, 04:11 AM
  4. vlookup & hlookup help??
    By 331 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-14-2012, 10:05 PM
  5. [SOLVED] VLOOKUP/HLOOKUP
    By MsNadi in forum Excel General
    Replies: 1
    Last Post: 02-10-2006, 03:50 PM
  6. [SOLVED] VLookup & HLookup
    By [email protected] in forum Excel General
    Replies: 2
    Last Post: 10-03-2005, 11:05 AM

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