+ Reply to Thread
Results 1 to 6 of 6

Error in index match function

  1. #1
    Registered User
    Join Date
    02-17-2012
    Location
    las vegas
    MS-Off Ver
    Excel 2007
    Posts
    33

    Error in index match function

    Hi all,

    I am trying to create a worksheet and it worked fine until I added a new rate column (for smoker). Is it possible to index two columns and create an index match if formula. Any help would be greatly appreciated. I have attached my worksheet. thanks

    My look up values are Plan, Age, Smoker yes or no ( from worksheet tab) that should get the rate from plan tab whether smoker or not.

    Sorry I cant attach file

    Plan tab
    A1:A10 Plans
    B1:b10 Age
    C1:C10 Smokers Rate
    D1:D10 Non-Smokers Rate

    Worksheet Tab
    A1 = Plan
    B1= Age
    C1 Smoker Y/N
    D should bring either C or D from Plan tab

  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: Error in index match function

    Hi and welcome to the forum

    why cant you attach your file?
    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
    02-17-2012
    Location
    las vegas
    MS-Off Ver
    Excel 2007
    Posts
    33

    Re: Error in index match function

    I apologize but I have never tried vba before can I just create an index match formula with if function?

    I tried this formula before with just one rate but got an error when I added another column for smokers rate.
    =INDEX(Plan!D:D,)*MATCH(1,(Worksheet!C3=Plan!B:B)*(Worksheet!A3=Plan!A:A),0)

    Help is greatly appreciated.

    I just keep getting an hour glass for a long time everytime I try to attach my file

  4. #4
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: Error in index match function

    Try

    =INDEX(IF(Worksheet!C1="Y",Plan!C:C,Plan!D:D),MATCH(1,(Worksheet!C3=Plan!B:B)*(Worksheet!A3=Plan!A:A),0))
    Life's a spreadsheet, Excel!
    Say thanks, Click *

  5. #5
    Registered User
    Join Date
    02-17-2012
    Location
    las vegas
    MS-Off Ver
    Excel 2007
    Posts
    33

    Re: Error in index match function

    works great thanks so much for your help

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

    Re: Error in index match function

    The index/match combo is fairly easy once you understand the syntax required. It is actually 2 formulas (well, 3 if you consider 2 match()'s) combined.

    =INDEX(range,row,column)

    =index(range-to-look-in,row-number-to-use,column-number-to-use) It will return the value at the intersection of the row and column

    Thats fine if you happen to know the row and column you want to use, but more often than not, at least 1 of those is not known. So this is where the match() comes in.
    =MATCH(criteria,range,0) 0=exact match, 1 = less than, -1 = greater than criteria
    =MATCH("TEST",A1:A10,0) This will search for an exact match of the word TEST in the range A1:A10, and tell you which row it was found in
    that takes care of finding the row...finding the column is exactly the same...
    =match("Jan",A1:J1,0) This will search for Jan in the range A1:J10

    So when you combine them all, you get...

    =index(A1:J10,match("Test",A1:A10,0),match("Jan"A1:J1,0))

    ...search for a cell in column A containing TEST - search for a column titled Jan in row 1...give me the contents of the intersection

    Hope that helped some?

+ 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. index function error using match function to get data from a cell in an array
    By mabildgaard in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-17-2013, 02:21 AM
  2. Replies: 3
    Last Post: 06-17-2013, 12:37 PM
  3. Replies: 3
    Last Post: 05-02-2013, 01:31 AM
  4. Index Match N/A Error
    By Henry c in forum Excel General
    Replies: 1
    Last Post: 08-19-2010, 04:07 AM
  5. [SOLVED] Error Return Value from and INDEX(A:2,MATCH()) function
    By BJ in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-26-2005, 11:06 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