+ Reply to Thread
Results 1 to 15 of 15

Modified Lookup

  1. #1
    Forum Contributor
    Join Date
    01-20-2014
    Location
    Greece
    MS-Off Ver
    20 yr. old Excel 2002!
    Posts
    710

    Modified Lookup

    Hi
    I would like help in a function that would look up numbers or numbers entered as text in f2:j11 and return the value in column A, if exact match or "Unknown" if not found.

    Also how to modify, if numbers were not in consecutive columns.

    Thanks
    Attached Files Attached Files

  2. #2
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,466

    Re: Modified Lookup

    With F14 is lookup number

    =INDEX(A:A,MAX(IF($F$2:$J$11=F14,ROW($F$2:$J$11))))
    Quang PT

  3. #3
    Forum Contributor
    Join Date
    01-20-2014
    Location
    Greece
    MS-Off Ver
    20 yr. old Excel 2002!
    Posts
    710

    Re: Modified Lookup

    I get #value! (A value used in the formula is of the wrong data type).


    phone.jpg
    Last edited by drgkt; 12-02-2015 at 03:44 AM.

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,054

    Re: Modified Lookup

    It works fine. However, Bebo forgot to tell you that it is an array formula.

    Array Formulae are a little different from ordinary formulas in that they MUST be confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER.

    You will know the array is active when you see curly braces { } appear around the outside of your formula. If you do not CTRL+SHIFT+ENTER you will (almost always) get an error message or an incorrect answer. Press F2 on that cell and try again.

    Don't type the curly braces yourself - it won't work...
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  5. #5
    Forum Contributor
    Join Date
    01-20-2014
    Location
    Greece
    MS-Off Ver
    20 yr. old Excel 2002!
    Posts
    710

    Re: Modified Lookup

    Indeed.
    Thank you!

    For a non found number I get A1 = (Name). How can I get "Uknown"?

    Also, what if the data were not in consecutive columns?

  6. #6
    Forum Expert
    Join Date
    12-09-2014
    Location
    Trakai, Lithuania
    MS-Off Ver
    2016
    Posts
    1,294

    Re: Modified Lookup

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

  7. #7
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,054

    Re: Modified Lookup

    OK. Another array formula, for the first part:

    =IFERROR(INDEX($A$2:$A$11,MAX(IF($F$2:$J$11=F14,ROW($F$2:$J$11)))-ROW($1:1)),"Unknown")

  8. #8
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Modified Lookup

    Assuming you're using Excel 2002 as your profile indicates.

    Try this array formula**:

    =IF(MAX(IF($F$2:$J$11=F14,ROW($F$2:$J$11)))=0,"Uknown",INDEX(A:A,MAX(IF($F$2:$J$11=F14,ROW($F$2:$J$11)))))

    ** array formulas need to be entered using the key
    combination of CTRL,SHIFT,ENTER (not just ENTER).
    Hold down both the CTRL key and the SHIFT key
    then hit ENTER.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  9. #9
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,054

    Re: Modified Lookup

    Thanks, Tony, I just spotted that....

    If you break up the range with text, it'll still work.
    Attached Files Attached Files

  10. #10
    Forum Contributor
    Join Date
    01-20-2014
    Location
    Greece
    MS-Off Ver
    20 yr. old Excel 2002!
    Posts
    710

    Re: Modified Lookup

    Strange I did not get any notifications about new posts. I let the webmaster know.

    Thank you all

    As to Czeslaw's proposed answer I get: #NAME?
    Last edited by drgkt; 12-03-2015 at 07:08 AM.

  11. #11
    Forum Expert
    Join Date
    12-09-2014
    Location
    Trakai, Lithuania
    MS-Off Ver
    2016
    Posts
    1,294

    Re: Modified Lookup

    Please Your example with my formula.
    Attached Files Attached Files

  12. #12
    Forum Contributor
    Join Date
    01-20-2014
    Location
    Greece
    MS-Off Ver
    20 yr. old Excel 2002!
    Posts
    710

    Re: Modified Lookup

    Sorry, I get #NAME? if not found !

    Please modify to get "Unknown"

  13. #13
    Forum Expert
    Join Date
    12-09-2014
    Location
    Trakai, Lithuania
    MS-Off Ver
    2016
    Posts
    1,294

    Re: Modified Lookup

    Please.
    I changed.
    Attached Files Attached Files

  14. #14
    Forum Contributor
    Join Date
    01-20-2014
    Location
    Greece
    MS-Off Ver
    20 yr. old Excel 2002!
    Posts
    710

    Re: Modified Lookup

    Thank you all.

    I just wanted you to know that if the number is entered as text it will be missed.
    Just type "50 in J11 and 50 in F14.

  15. #15
    Forum Contributor
    Join Date
    01-20-2014
    Location
    Greece
    MS-Off Ver
    20 yr. old Excel 2002!
    Posts
    710

    Re: Modified Lookup

    The non array formula will give erroneous results if it is used with reference to another workbook.

+ 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. Add date last modified
    By Smoovin in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-15-2014, 06:32 PM
  2. [SOLVED] Modified Lookup value
    By stegngas in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-20-2014, 02:57 PM
  3. [SOLVED] V-Lookup with Modified Results ("Y" for Yes or Blank for No)
    By garrett.grillo in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-28-2013, 02:34 AM
  4. Modified lookup function
    By maacmaac in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-09-2009, 08:04 PM
  5. [SOLVED] Last Modified
    By Steve in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-20-2006, 01:35 PM
  6. Modified Box and Whisker
    By Rianne in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 03-23-2006, 11:40 PM
  7. modified date
    By ceemo in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-29-2005, 02: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