+ Reply to Thread
Results 1 to 6 of 6

Help with unfamiliar lookup()

Hybrid View

  1. #1
    Registered User
    Join Date
    08-07-2017
    Location
    New York, NY
    MS-Off Ver
    MS 2016
    Posts
    2

    Question Help with unfamiliar lookup()

    Hi Everyone,

    First post! I have inherited a spreadsheet that from a retiring analyst. This formula returns the last number in the column. I just don't know how it works. I have not seen the lookup used this way before. Can anyone help me with this (see below)?

    =LOOKUP(2,1/('Sheet 1'!U:U<>""),'Sheet 1'!U:U)

    Thanks in advance!

  2. #2
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Help with unfamiliar lookup()

    'Sheet 1'!U:U<>"" is an expression, or a question, and it has a True or False answer.
    So it goes through the range U:U, and asks the question at each cell
    <>"" is basically 'Not blank'
    Is U1 Not Blank
    Is U2 Not Blank
    Is U3 Not Blank
    etc..

    So you end up with an array containing all the true or false answers to that question.
    =LOOKUP(2,1/({True,False,False,True,True,False,etc}),'Sheet 1'!U:U)

    Each True and False is then divided into 1.
    So you have an array of divisions
    =LOOKUP(2,{1/True,1/False,1/False,1/True,1/True,1/False,etc},'Sheet 1'!U:U)

    When applying a math operation like / divisition, then True = 1 and False = 0
    =LOOKUP(2,{1/1, 1/0, 1/0, 1/1, 1/1, 1/0},'Sheet 1'!U:U)

    1/1 = 1
    1/0 = #Div/0! error
    =LOOKUP(2,{1, #Div/0!, #Div/0!, 1, 1, #Div/0!},'Sheet 1'!U:U)


    Now a nice feature of Lookup is that it ignores error values like #Div/0!
    And since the lookup value (2) is larger than all numeric values in the lookup range
    Lookup then results in the last (furthest to the right) numeric value in the lookup range.


    Hope that helps.

  3. #3
    Registered User
    Join Date
    08-07-2017
    Location
    New York, NY
    MS-Off Ver
    MS 2016
    Posts
    2

    Re: Help with unfamiliar lookup()

    Quote Originally Posted by Jonmo1 View Post
    'Sheet 1'!U:U<>"" is an expression, or a question, and it has a True or False answer.
    So it goes through the range U:U, and asks the question at each cell
    <>"" is basically 'Not blank'
    Is U1 Not Blank
    Is U2 Not Blank
    Is U3 Not Blank
    etc..

    So you end up with an array containing all the true or false answers to that question.
    =LOOKUP(2,1/({True,False,False,True,True,False,etc}),'Sheet 1'!U:U)

    Each True and False is then divided into 1.
    So you have an array of divisions
    =LOOKUP(2,{1/True,1/False,1/False,1/True,1/True,1/False,etc},'Sheet 1'!U:U)

    When applying a math operation like / divisition, then True = 1 and False = 0
    =LOOKUP(2,{1/1, 1/0, 1/0, 1/1, 1/1, 1/0},'Sheet 1'!U:U)

    1/1 = 1
    1/0 = #Div/0! error
    =LOOKUP(2,{1, #Div/0!, #Div/0!, 1, 1, #Div/0!},'Sheet 1'!U:U)


    Now a nice feature of Lookup is that it ignores error values like #Div/0!
    And since the lookup value (2) is larger than all numeric values in the lookup range
    Lookup then results in the last (furthest to the right) numeric value in the lookup range.


    Hope that helps.
    Wow! Thank you Jonmo1! This makes a lot more sense now. It really does help!

  4. #4
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Help with unfamiliar lookup()

    Now, all that said.

    Here is a far more efficient formula to find the last number in a range

    =LOOKUP(9.99999999999999E+307,'Sheet 1'!U:U)

  5. #5
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Help with unfamiliar lookup()

    You're welcome.

  6. #6
    Forum Expert leelnich's Avatar
    Join Date
    03-20-2017
    Location
    Delaware, USA
    MS-Off Ver
    Office 2016
    Posts
    2,807

    Re: Help with unfamiliar lookup()

    Here's a corollary to @Jonmo1 's post #3 formula. This one finds the last TEXT in the range:

    =LOOKUP(REPT("z",255),'Sheet 1'!U:U)

    Please click the Add Reputation star below any helpful posts, and if you have your answer, mark your thread as SOLVED (Thread Tools up top). Thanks!-Lee
    Last edited by leelnich; 08-07-2017 at 02:18 PM.

+ 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. Two Lookup and Return (Lookup the column, then lookup the row)
    By Branbran10 in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 08-05-2015, 04:55 PM
  2. Replies: 3
    Last Post: 04-08-2014, 03:11 AM
  3. Replies: 2
    Last Post: 05-19-2013, 08:46 AM
  4. Replies: 7
    Last Post: 06-19-2011, 12:51 PM
  5. Simple function I am unfamiliar With.
    By bcgaddis in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-18-2008, 04:56 PM
  6. how do I identify an unfamiliar symbol in an excel cell
    By Yosef2 in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 09-16-2005, 01:15 PM
  7. [SOLVED] Column lines:unfamiliar icons on the tool bar on my Office 2000
    By tee.cee in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 03-21-2005, 12:06 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