+ Reply to Thread
Results 1 to 6 of 6

Creating a match index formula comparing two variables in two worksheets

  1. #1
    Forum Contributor
    Join Date
    05-01-2013
    Location
    Richmond, VA
    MS-Off Ver
    Excel 365
    Posts
    164

    Creating a match index formula comparing two variables in two worksheets

    I am trying to compare two different vlaues in two different columns in two different worksheets. If the values in both columns match it will result in a value of "Scheduled" by using the INDEX part of the formula. I have a formula for match index that I use often (see copy below), but it only matches one value in one colume. I can't figure out how to include another column/value to match.

    =IF(ISNA(MATCH(C2,Main!$A:$A,0)),0,INDEX(SCHEDULE!$B:$B,MATCH(C2,Main!$A:$A$,0)))

    There are three changes I want to make to this formula:

    1. Match two values in two columns (one value in each column)

    2. Instead of the Index returning a value from another column, return a value that I write into the formula. In this case, if the month values and the circuit values match in both worksheets, then return the value "Scheduled."

    I also want to reference entire columns instead of specific row numbers in a column, hence the A:A designation instead of A2:A400 for example.

    Thanks!

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

    Re: Creating a match index formula comparing two variables in two worksheets

    I can't figure out how to include another column/value to match.
    You cant, not with INDEX/MATCH. It will find the 1st match (or 1 below the closest match, in your case), then stop looking.

    If you want to return multiple matches, you would need to use the INDEX/SMALL/IF ARRAY. Upload a small (clean) sample workbook (not a pic) of what you are working with, and what your expected outcome would look like.
    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
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.83 (24031120))
    Posts
    8,732

    Re: Creating a match index formula comparing two variables in two worksheets

    ignore, i was going to suggest two index/match in an AND and use an IF but FDibbins has replied
    Last edited by etaf; 03-12-2015 at 11:48 AM.
    Wayne
    if my assistance has helped, and only if you wish to , there is an "* Add Reputation" on the left hand side - you can add to my reputation here

    If you have a solution to your thread - Please mark your thread solved do the following: >
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  4. #4
    Forum Contributor
    Join Date
    05-01-2013
    Location
    Richmond, VA
    MS-Off Ver
    Excel 365
    Posts
    164

    Re: Creating a match index formula comparing two variables in two worksheets

    Here is a very basic and brief sample. Column F is where the formula will go and where if columns A and D in this Main worksheet match columns A and C in the SCHEDULED worksheet.
    Attached Files Attached Files

  5. #5
    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,926

    Re: Creating a match index formula comparing two variables in two worksheets

    My apologies, I completely mis-understood. Try this, copied down...
    =IF(ISERROR(MATCH(A2&D2,INDEX(SCHEDULED!$C$1:$C$10000&SCHEDULED!$A$1:$A$10000,0),0)),"","Scheduled")

    I also want to reference entire columns instead of specific row numbers in a column
    Regarding that request, it is often better to use specified ranges that are 2-3 times more than you think you would need, rather than full-column ranges. Full-column ranges can tend to slow your file down. Excel (>=2007) has over 1 million rows, so even using 10 000 like i did, is far better than using 1 048 576 rows.

    As a test, use what I suggested - as I have it, copied down. Then change to full-column ranges and copy that down. Take not of the time delay

  6. #6
    Forum Contributor
    Join Date
    05-01-2013
    Location
    Richmond, VA
    MS-Off Ver
    Excel 365
    Posts
    164

    Re: Creating a match index formula comparing two variables in two worksheets

    Thank you for this formula. I did have an issue with it though and want to see if you can help me. Please note that I only had to make one change to what you provided (changed the D2 to E2). However, when I put the formula in the cell and press "Enter," the window that you would see to save a new file opens automatically. It also returns blank values in the cells when it should show "Scheduled" as I validated this data part.

    I have had this happen before, and usually I could fix it by fixing something in the formula, but I am not seeing where to fix anything with what you provided - looks pretty straight forward. Can you help me with this issue?

    =IF(ISERROR(MATCH(A2&E2,INDEX(SCHEDULED!$C$1:$C$10000&SCHEDULED!$A$1:$A$10000,0),0)),"","Scheduled")

+ 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. [SOLVED] Formula to Index and Match across mutiple worksheets not working
    By Tryin2Excel in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 07-20-2016, 12:15 PM
  2. help with creating array formula to index and match
    By anfdrew in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-14-2014, 10:42 PM
  3. [SOLVED] Creating a Formula to Index/Match for Specific Data
    By fearonc in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-18-2014, 11:50 PM
  4. [SOLVED] Help creating a formula that using If,index, match and displays only the newest dates...
    By JasonNeedsHelp in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 10-16-2013, 02:28 PM
  5. [SOLVED] Comparing list using INDEX MATCH etc. in an array-formula
    By Saturn in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 04-14-2013, 09:02 AM

Tags for this Thread

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