+ Reply to Thread
Results 1 to 8 of 8

Help on lookup formulae

  1. #1
    Forum Contributor leo73pk's Avatar
    Join Date
    09-28-2006
    Location
    UAE
    MS-Off Ver
    2016, Microsoft 365
    Posts
    294

    Help on lookup formulae

    I received a template wherein a formula is given as follows;

    IFERROR(LOOKUP(2,1/(C5:CC5<>""),C5:CC5),"0")

    I would like to know the interpretation of this lookup formula as i'm unable to understand what is meant by Lookup(2, 1/ part of the formula.
    Last edited by leo73pk; 10-16-2017 at 02:20 AM. Reason: Solved
    Best Regards,
    Hamza


    It is the greatest of all mistakes to do nothing because you can only do little - do what you can.

  2. #2
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,156

    Re: Help on lookup formulae

    hey there. one useful trick to learn when understanding formulas is to press the F9 key to calculate. So go to the cell where the formula resides and click inside the formula bar. select the individual parts of the formula which you don't understand and press F9 to calculate.

    select this part and press F9 to calculate:
    (C5:CC5<>"")
    let's assume the data is blank, non-blank, non-blank, blank, etc. it will show as:
    {FALSE,TRUE,TRUE,FALSE,and so on....

    the formula then uses 1 divided by a bunch of TRUEs and FALSEs. TRUE is recognized as 1 in Excel and FALSE as 0. so 1 / TRUE is 1 and 1 / FALSE is a DIV error. so:
    {#DIV/0!,1,1,#DIV/0!,and so on...

    my lookup_value is 2, so since the LOOKUP cannot find an exact match, it returns the last number found; the 2nd non-blank. using C5:CC5 in the result_vector, it will give the value of the 2nd non-blank cell.

    hope that helps

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  3. #3
    Forum Contributor leo73pk's Avatar
    Join Date
    09-28-2006
    Location
    UAE
    MS-Off Ver
    2016, Microsoft 365
    Posts
    294

    Re: Help on lookup formulae

    Thanks for your reply. Is there any other formula to perform the same task?

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

    Re: Help on lookup formulae

    Here's an array formula that does the same thing. Paste it in the formula bar and then press CTRL+SHIFT+ENTER to confirm array status.
    Please Login or Register  to view this content.
    Clicking the Add Reputation star below helpful posts is a great way to show your appreciation.
    Please mark your threads as SOLVED upon conclusion (Thread Tools above Post # 1). - Lee

  5. #5
    Forum Contributor leo73pk's Avatar
    Join Date
    09-28-2006
    Location
    UAE
    MS-Off Ver
    2016, Microsoft 365
    Posts
    294

    Re: Help on lookup formulae

    Thanks for your response Leelnich. your proposed formula works.

    I'm enclosing the actual file for better understanding

    In this spreadsheet I have following information

    Range C3:AR12
    Range C15:AR23
    Range C26:AR35
    Range C38:AR46

    My requirement is to review Country wise Last order quantity, order number and order date. For that I have applied formulas in table F52:H58 which are giving me the desired results

    Kindly suggest me more efficient way i.e. in terms of data layout and formulas to achieve the desired results, other than pivot table.
    Attached Files Attached Files

  6. #6
    Forum Contributor leo73pk's Avatar
    Join Date
    09-28-2006
    Location
    UAE
    MS-Off Ver
    2016, Microsoft 365
    Posts
    294

    Re: Help on lookup formulae

    Let me reiterate my requirement as follows;

    My requirement is to review Last order quantity, order number and order date placed by each Country. For that I have data table with requisite details in enclosed sheet.

  7. #7
    Forum Contributor leo73pk's Avatar
    Join Date
    09-28-2006
    Location
    UAE
    MS-Off Ver
    2016, Microsoft 365
    Posts
    294

    Re: Help on lookup formulae

    Quote Originally Posted by leelnich View Post
    Here's an array formula that does the same thing. Paste it in the formula bar and then press CTRL+SHIFT+ENTER to confirm array status.
    Please Login or Register  to view this content.
    Thanks Leelnich. The proposed formula solve the issue.

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

    Re: Help on lookup formulae

    Thank you for the rep! Happy to help, though I personally prefer some version of your original LOOKUP() formula because it usually* doesn't require CSE/array entry (even experienced programmers forget to press C+S+E occasionally ). Of course, neither would this:
    Please Login or Register  to view this content.
    ...since MATCH() can also find the largest number less than or equal to lookup_value while ignoring #DIV/0! errors. However, it requires another "trick" - wrapping the lookup_array in an extra INDEX() function - to avoid CSE.

    *NOTE: Lookup_arrays generated with IF() statements - as in my post #4 solution - ALWAYS require CSE! I suppose I could have worked around that with:
    Please Login or Register  to view this content.
    ...,but this is long, awkward, AND obscure. I usually try to strike a balance between clarity of function and calculational efficiency.
    Last edited by leelnich; 10-16-2017 at 07:02 AM.

+ 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. Lookup Or Vlookup Formulae 4 whole Workbook??
    By deepak8583 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-19-2014, 06:33 AM
  2. [SOLVED] Help with Lookup formulae please :)
    By twrmotorsport in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 09-25-2013, 09:48 AM
  3. [SOLVED] Formulae or Lookup Tables?
    By OverKnight in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 07-24-2013, 12:13 PM
  4. [SOLVED] Understand lookup, index & match formulae
    By Dushantha in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-18-2012, 05:50 AM
  5. Issue with LOOKUP and Advice on crrect formulae
    By pranabdeb in forum Excel General
    Replies: 8
    Last Post: 04-18-2012, 03:44 AM
  6. 4 criteria lookup formulae
    By Hitmanforprez in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-14-2007, 08:23 PM
  7. Searching TEXT in formulae, rather than results of formulae
    By AndyE in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 10:05 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