+ Reply to Thread
Results 1 to 13 of 13

how to use vlookup return only some condition satisfies

  1. #1
    Registered User
    Join Date
    09-06-2013
    Location
    india
    MS-Off Ver
    Excel 2003
    Posts
    10

    how to use vlookup return only some condition satisfies

    hi
    i have an exel sheet with lot of data.
    i want to use vlookup function for getting what cell i want. the same time it will also check if and only if two cells are matching then return the result.
    is it possible. please guide me.

    for example:

    101 3.2 7.3 200 500
    102 5.2 8.3 200 450
    103 3.2 7.3 200 750
    101 7.3 7.3 200 450
    102 7.3 7.3 200 500

    103 7.3 7.3 200 600

    if my lookup_value is 103(ie A3 ) in this table array and required column is 6th column(ie E6). return the value if and only if B & C cells of the corresponding row matches. In the example B6=C6 then return the E6=600.
    if i am using without this condition it returns the same row values ie E3=750 required is E6=600
    gvg

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,936

    Re: how to use vlookup return only some condition satisfies

    I think you will need to upload a sample workbook, showing what you have and what you want?
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    09-06-2013
    Location
    india
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: how to use vlookup return only some condition satisfies

    hi FDibbins,

    thank you for you reply
    i am attaching here the excel sheet
    i have coloured in the excel sheet
    i am getting wrong results as i explained in the previous post.
    while vlookup it has to satisfy the condition C = J of the matched row.
    i thing it can be done by two ways but i dont know is it possible or not.
    i)to exclude row which have lookup_value
    ii) any conditional with vlookup

    please guide me
    Attached Files Attached Files
    Last edited by gvgbabu; 04-26-2014 at 09:50 PM.

  4. #4
    Registered User
    Join Date
    03-22-2014
    Location
    Philippines
    MS-Off Ver
    Excel 2007,2010
    Posts
    39

    Re: how to use vlookup return only some condition satisfies

    hi gvgbabu ,

    i'm a bit confused in your worksheet. you can use the "if" function for conditions (vlookup)

    can you insert column with your required result? many in the forum can help you.

    Thanks

  5. #5
    Registered User
    Join Date
    09-06-2013
    Location
    india
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: how to use vlookup return only some condition satisfies

    hi

    i explain with example

    this is the 419 row in the sheet

    1089 414 20.25 5.65 -8.46 #N/A #N/A #N/A 416 24.38 5.65 -8.46 230 600 0 4130 230 725 414 230 725 416 230 425

    lookup_value:414
    required columns: Q & R

    but it lookup from B2 and selecting the same row which has looup value and returns 230 725.

    the required rows while lookup are 429 and 430 row numbers

    for lookup_value 414 this is row and retrun 230 425

    1099 414 20.25 5.65 -8.46 #N/A #N/A #N/A 425 20.25 5.65 -6.23 #N/A #N/A #N/A 2230 230 425 414 230 725 425 230 725

    for lookup_value 416 this is row and retrun 230 425

    1100 416 24.38 5.65 -8.46 230 600 0 426 24.38 5.65 -6.23 300 600 0 2230 230 425 416 230 425 426 230 500

  6. #6
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,648

    Re: how to use vlookup return only some condition satisfies

    Something like this........

    Array Formula in T2 (requires Ctrl+Shift+Enter not only Enter)

    Please Login or Register  to view this content.
    Regards
    sktneer


    Treat people the way you want to be treated. Talk to people the way you want to be talked to.
    Respect is earned NOT given.

  7. #7
    Registered User
    Join Date
    09-06-2013
    Location
    india
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: how to use vlookup return only some condition satisfies

    hi sktneer

    thank you for your reply
    but i am not getting correct value.

    please explain the arrayt in detail .

    thanks
    gvg

  8. #8
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,648

    Re: how to use vlookup return only some condition satisfies

    To understand what is this array formula doing, use this formula on a small set of data. In the attached workbook, I have taken the example you posed in your post#1. In the formula lookup value is 103. Notice what is the difference between the regular formula (yours) and array formula.
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    09-06-2013
    Location
    india
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: how to use vlookup return only some condition satisfies

    its giving the correct result while checking with my first post.
    when i am checking with my excel sheet "input" its not giving correct results.
    please check with my input sheet

  10. #10
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,648

    Re: how to use vlookup return only some condition satisfies

    First you must understand what this formula is doing.
    what it does, it finds all the rows where lookup value 103 is in col. A and col. B and Col. C have the same value, if there are one or more such rows, it returns the corresponding value of col. E for from the first row.

    The formula works same in your input sheet. It find all the rows with lookup value where col. C and Col. J have the same value and return the value from the column with col.index in the formula.

    So in the formula.....

    Please Login or Register  to view this content.
    The formula finds all the rows in B2:B15000 where the lookup value is equal to B2. If it finds one or more such rows, It checks further that the corresponding values in col. C and col. J are same and if it finds any such rows, it returns the corresponding value from col. Q from the first row it finds.

  11. #11
    Registered User
    Join Date
    02-20-2014
    Location
    london
    MS-Off Ver
    Excel 2003
    Posts
    14

    Re: how to use vlookup return only some condition satisfies

    hi
    i m having same problem but i need to get data from other sheet. Can i use this formula. here is details of my problem.
    HI Sir,
    I have 2 sheets in same spread sheet with following columns in each sheet.
    1. zone
    2. date
    3. representative
    4. commission earned
    I want to copy commission earned on sheet 1 column “Y”( namely RICARDO)from sheet to 2 (namely OCT – FEB) ,if following condition is fulfilled/ satisfied.
    All these values (Zone , date, representative and commission) of both sheets is same then commission of 2nd sheet should be copied on sheet 1 column “Y”

    I am using excel 2010 , window8 and an HP lap top.
    If you dont find my up loaded file in bluebox, pls let me know how can I send you my sheet. I had tried to take print shot but it did not work. Please help me out in this matter thanks.
    I have uploaded/ shared my file on following link.

    https://app.box.com/s/g3jip0ky22it0ack9xov

    if you donot finf my sheets, please advise me how to attach sheets on this forum.
    thanks

    Kind regards.

  12. #12
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,936

    Re: how to use vlookup return only some condition satisfies

    gillani77 welcome to the forum

    Unfortunately your post does not comply with Rule 2 of our Forum RULES. Do not post a question in the thread of another member -- start your own thread.

    If you feel an existing thread is particularly relevant to your need, provide a link to the other thread in your new thread.

    Old threads are often only monitored by the original participants. New threads not only open you up to all possible participants again, they typically get faster response, too.


    Also, please upload your sample workbook to this forum, not all members are able - or willing - to access file-hosting web sites

  13. #13
    Registered User
    Join Date
    02-20-2014
    Location
    london
    MS-Off Ver
    Excel 2003
    Posts
    14

    Re: how to use vlookup return only some condition satisfies

    Hi FDibbins,
    thanks for your advice. I am going to post my problem in new thread.

+ 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. Replies: 11
    Last Post: 10-08-2013, 12:23 AM
  2. A condition true if one element in a row of a matrix satisfies it
    By giovannioh in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 12-29-2010, 07:09 AM
  3. A script that satisfies a condition, to change the input column
    By kostas in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-25-2007, 04:28 AM
  4. Copying rows which satisfies a filtering condition
    By blurtoad in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-06-2007, 11:31 AM
  5. [SOLVED] How to input cellcontent within worksheets if satisfies condition
    By Vinitha in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 08-03-2006, 08:00 AM

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