+ Reply to Thread
Results 1 to 8 of 8

nesting MATCH and VLOOKUP in IF_AND statement

  1. #1
    Registered User
    Join Date
    07-07-2013
    Location
    Stara Zagora, Bulgaria
    MS-Off Ver
    Excel 2007
    Posts
    4

    nesting MATCH and VLOOKUP in IF_AND statement

    Hi FDibbins, thank you to remind me that it's usefully to read the rules not just to check the box when one fill in the register form. I'm apologize for doing that. I appreciate your tolerance.

    Now I will return to the purpose of the post. I'm trying to use MATCH function (TBLs!B12; TBLs!B13; TBLs!E12;TBLs!E13) as a logical tests in IF and AND statement. I want for home team (DATA!H) or away team (DATA!I) to get the result (DATA!P for home team; DATA!Q for away team) only if both logical tests (A12 MATCH in DATA!C and B1 MATCH in DATA!H for home team), (A12 match in DATA!C and E1 MATCH in DATA!I for away team) are TRUE, if either is FALSE I want formula to point me that team played HOME or AWAY in the corresponding round. I also tried to used VLOOKUP function (TBLs!B2; TBLs!B3; TBLs!E2;TBLs!E3), but by both of these efforts I constantly get irrelevant results and I can't resolve it.

    I will appreciate to all you for help me to resolve that problem.

    Have a great day,
    Rosen
    Attached Files Attached Files
    Last edited by RoKo2013; 07-08-2013 at 04:24 PM. Reason: to change the title and content of the post

  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,939

    Re: help me with (I suppose) the IF, VLOOKUP or nesting any of them into one another

    Hi and welcome to the forum

    Please take a minute to read forum rule #1...

    1. Use concise, accurate thread titles. Your post title should describe your problem, not your anticipated solution. Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.
    To change a Title on your post, click EDIT on you're 1st post, then Go Advanced and change your title"

    Also, i would suggest you upload a sample work book, (all sensitive data removed), showing what data you are working with, a few examples of what your expected outcome is, and how you arrived at that

    To attach a file to your post,
    click advanced (next to quick post),
    scroll down until you see "manage file",
    click that and select "add files" (top right corner).
    click "select files" find your file, click "open" click "upload" click 'done" bottom right. click "submit reply"

    Once the upload is completed the file name will appear below the input boxes in this window.
    You can then close the window to return to the new post screen.
    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
    07-07-2013
    Location
    Stara Zagora, Bulgaria
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: nesting MATCH and VLOOKUP in IF_AND statement

    Hello again folks, I added new file where I simplify the example of the data. In the sheet "DesiredResult" I demonstrate what I want to achieve. In the sheet "DATA" I show you how I try to achieved it.

    I used "AND" function in "IF" statement and then used "MATCH" function for both "logical 1" and "logical 2". If return from both logical test is "TRUE" then I used "VLOOKUP" function to get a value in column "C" for the same row, where "VLOOKUP" match the criteria. If return from either logical test is "False", I want to return text "AWAY", as the team didn't play a game on own ground.

    Formula is as follow:
    =IF(AND(MATCH(J1;A2:A33;0);MATCH(I5;B2:B33;0));VLOOKUP(I5;B2:D33;3;FALSE);"AWAY")

    What I get as a return is a value from "column C" when for first time both logical test are "TRUE".

    May be It's not correct to use "VLOOKUP" when both logical test are "TRUE".

    Any help is appreciate. Thank's in advance.

    Rosen
    Attached Files Attached Files

  4. #4
    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,939

    Re: nesting MATCH and VLOOKUP in IF_AND statement

    Thanks for the title change and for the understaning

    for table 1, use this array formula...
    =IFERROR(INDEX($A$2:$G$50,MATCH(J$1&$I2,$A$2:$A$50&$B$2:$B$50,0),COLUMN(D$1)),"AWAY")

    And fot the away results, use this array formula...
    =IFERROR(INDEX($A$2:$G$50,MATCH(J$1&$I20,$A$2:$A$50&$C$2:$C$50,0),COLUMN(D$1)),"HOME")

    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 your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer. Press F2 on that cell and try again.

    Once you have the 1st 1 in, copy/paste down and across. repeat for the 2nd 1

  5. #5
    Registered User
    Join Date
    07-07-2013
    Location
    Stara Zagora, Bulgaria
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: nesting MATCH and VLOOKUP in IF_AND statement

    Hi FDibbins, thank you very much for your solution. It's solve my problem. You are my STAR-man.

    Have a grate day,
    Rosen

  6. #6
    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,939

    Re: nesting MATCH and VLOOKUP in IF_AND statement

    Based on your last post it seems that you are satisfied with the solution(s) you've received but you haven't marked your thread as SOLVED. If your problem has not been solved you can use Thread Tools (located above your first post) and choose "Mark this thread as unsolved".
    Thanks.

    Also, as a relatively new member of the forum, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

  7. #7
    Registered User
    Join Date
    07-07-2013
    Location
    Stara Zagora, Bulgaria
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: nesting MATCH and VLOOKUP in IF_AND statement

    Just before few minutes I clicked your star. Since my English's vocabulary is poor in words It takes me a little more time to write an answer.

    I forgot to mark the thread as Solved, but I will correct it in a few seconds.

    Have a great day,
    Rosen

  8. #8
    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,939

    Re: nesting MATCH and VLOOKUP in IF_AND statement

    Thanks for the feedback

+ 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