+ Reply to Thread
Results 1 to 3 of 3

Advance LookUp....

  1. #1
    Registered User
    Join Date
    03-11-2006
    Posts
    11

    Advance LookUp....

    Hi all
    I have a table like this in one sheet 1

    A B C
    --- ---- -------
    10 20 1020
    20 30 2030
    30 40 3040
    ....
    .......
    ...........

    in sheet2 when a user enters a number in cell A1 ,then i want to search above records and return apprpriate result
    based the following formula to the cell A2:

    10>= user input >=20 --> return 1020
    20>= user input >=30 --> return 2030
    30>= user input >=40 --> return 3040

    how can i do that with excell functions

    Kind Regards.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Advance LookUp....

    You don't actually need the column B on the Sheet1 table, a lookup table only needs:
    1) The column A data needs to be sorted ascending
    2) The column A data represents the beginning of each range
    3) The data to return in a column to the right somewhere.


    So, based on that, the formula on sheet2 in cell B1 could be:

    =LOOKUP(A1, Sheet1!A:A, Sheet1!C:C)

    or

    =VLOOKUP(A1, Sheet1!A:C, 3, TRUE)

    or

    =INDEX(Sheet1!C:C, MATCH(A1, MATCH(A1, Sheet1!A:A, TRUE))
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    03-11-2006
    Posts
    11

    Re: Advance LookUp....

    Quote Originally Posted by JBeaucaire View Post
    You don't actually need the column B on the Sheet1 table, a lookup table only needs:
    1) The column A data needs to be sorted ascending
    2) The column A data represents the beginning of each range
    3) The data to return in a column to the right somewhere.


    So, based on that, the formula on sheet2 in cell B1 could be:

    =LOOKUP(A1, Sheet1!A:A, Sheet1!C:C)

    or

    =VLOOKUP(A1, Sheet1!A:C, 3, TRUE)

    or

    =INDEX(Sheet1!C:C, MATCH(A1, MATCH(A1, Sheet1!A:A, TRUE))
    Hi JBeaucaire
    Thanks for your reply
    To tell you the truth , in real situation that table may change like this

    10 15 result1
    42 105 result 2
    ...
    ....
    so i should serach for appropriate record and then ...
    now how can i handle this condition?
    once again thank you for following my problem.
    Regards.
    Last edited by ZarrinPour; 05-31-2010 at 01:33 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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