+ Reply to Thread
Results 1 to 9 of 9

Using Lookup with a Two Column Lookup Range

  1. #1
    Registered User
    Join Date
    02-11-2015
    Location
    Philadelphia
    MS-Off Ver
    Excel 2008 for Mac
    Posts
    6

    Using Lookup with a Two Column Lookup Range

    Hello,

    I have looked around and I can't seem to find a formula that does what I want to do without using arrays.

    What I want is a formula that can lookup the last value in either of two columns, and then return the corresponding value that is 10 columns over. What I am doing now is basically an IF function:

    =IF(MAX(IF($B$2:$B33=B34,ROW($B$2:$B33)))>MAX(IF($C$2:$C33=B34,ROW($C$2:$C33))),LOOKUP(2,1/($B$2:$B33=B34),$K$2:$K33),LOOKUP(2,1/($C$2:$C33=B34),$L$2:$L33))

    This finds the column where the last item in B34 is, and then LOOKUPs from bottom to top based on that. The trouble is that it uses arrays, and when translating between Excel and Google Sheets, (because my school uses Chromebooks) the formula gets corrupted. Also, arrays can be a pain, because of having to use ctrl-shift-enter every time I modify a function.

    I figured a simpler way to go around this would be to have Excel find the last value in either of two columns using a two-column lookup range (and a two-column result range). Then, Excel would look 10 columns over to find the value. Does anyone have any idea to do this, and if not using this method, another way?

    Also, please do not simply hand me a formula without explaining it. I would like to know why it is the way it is. For example, I have no idea why the =LOOKUP(2,1/( has a lookup value of "2", because there were never any explanations where I've seen it.

    Thanks. This forum has helped me many times before when I have needed to find a formula. Unfortunately, since I couldn't find this one, I needed to create a new thread.

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,627

    Re: Using Lookup with a Two Column Lookup Range

    Your explanation is not clear.

    1. Do columns B and C both have multiple occurrences of the value in B34 and you want the one that's furthest down in either column? Or, are column B and C different lengths and you want to find the last row of each and use the value at the bottom of the longest one.

    2. .... This finds the column where the last item in B34 is... B34 is a cell which should have a single value, I don' know what you mean here.

    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
    Ben Van Johnson

  3. #3
    Registered User
    Join Date
    02-11-2015
    Location
    Philadelphia
    MS-Off Ver
    Excel 2008 for Mac
    Posts
    6

    Re: Using Lookup with a Two Column Lookup Range

    Quote Originally Posted by protonLeah View Post
    Do columns B and C both have multiple occurrences of the value in B34 and you want the one that's furthest down in either column?
    This. I want the furthest down, (or in other words, first previous) occurance of B34 in either B or C. Then I want to lookup a corresponding value 10 columns over from that cell.

    It was kind of hard to explain, so thanks for clarifying. Your second question is basically about me just trying to reiterate what I had said earlier.

    I will attach a sample worksheet when I get on my main computer.

    Thanks

  4. #4
    Registered User
    Join Date
    02-11-2015
    Location
    Philadelphia
    MS-Off Ver
    Excel 2008 for Mac
    Posts
    6

    Re: Using Lookup with a Two Column Lookup Range

    Workbook1.xlsx

    Here is a sample workbook. One cell uses my current formula, and I left a blank spot open for the new formula.

  5. #5
    Registered User
    Join Date
    02-11-2015
    Location
    Philadelphia
    MS-Off Ver
    Excel 2008 for Mac
    Posts
    6

    Re: Using Lookup with a Two Column Lookup Range

    bump no solution

  6. #6
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,627

    Re: Using Lookup with a Two Column Lookup Range

    I don't understand your formula, you have two nested IF's but each one is missing the FALSE condition. Can you explain in words what the calculations are supposed to do?


    =IF(MAX(IF($B$2:$B2=C3,ROW($B$2:$B2)))>MAX(IF($C$2:$C2=B3,ROW($C$2:$C2))),LOOKUP(2,1/($B$2:$B2=B3),$K$2:$K2),LOOKUP(2,1/($C$2:$C2=B3),$L$2:$L2))

  7. #7
    Registered User
    Join Date
    02-11-2015
    Location
    Philadelphia
    MS-Off Ver
    Excel 2008 for Mac
    Posts
    6

    Re: Using Lookup with a Two Column Lookup Range

    Quote Originally Posted by protonLeah View Post
    I don't understand your formula, you have two nested IF's but each one is missing the FALSE condition. Can you explain in words what the calculations are supposed to do?
    I Googled how to find the highest numbered row in which a certain value is found, and I adopted the formula to create my logical test. All I know is that each MAX(IF...ROW returns the number of the highest row, and that the LOOKUPs are determined based on that.
    Last edited by Ike348; 02-13-2015 at 06:43 PM. Reason: misspelling

  8. #8
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,627

    Re: Using Lookup with a Two Column Lookup Range

    G4:
    Please Login or Register  to view this content.
    H4:
    Please Login or Register  to view this content.
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    02-11-2015
    Location
    Philadelphia
    MS-Off Ver
    Excel 2008 for Mac
    Posts
    6

    Re: Using Lookup with a Two Column Lookup Range

    Thanks for your formula. I was able to take pieces of it and plug it in to my old formula, and it works great.

    This is my new formula, thanks to your help, for G2:

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

+ 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. How to use vlookup if value of lookup cell is same in lookup range
    By anujteetwal in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-09-2014, 05:15 AM
  2. Replies: 3
    Last Post: 04-08-2014, 03:11 AM
  3. [SOLVED] Lookup help - can lookup address values that fall within a range?
    By Ruthie83 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 05-16-2013, 10:25 PM
  4. Replies: 5
    Last Post: 02-24-2011, 11:26 AM
  5. Lookup adjacent column to multiple lookup columns.
    By JAMES4228 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-13-2009, 03:19 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