+ Reply to Thread
Results 1 to 7 of 7

Thread: Index Match with IF

  1. #1
    Registered User
    Join Date
    08-10-2007
    Posts
    91

    Index Match with IF

    Hi,

    see attached file..

    i cant seem to figure out why the formula is not working..

    with only reference (one column) it works.. but not with crosschecking with two columns..
    i even tried with added vlookup..

    Could you please check the formula what went wrong?

    Its about multiple way matching..
    if city matches, then if company matches = Col C Number
    if city matches, then company doesnt match but sub company matches = Col D Number
    and so on
    i also plan to add 2 more columns like that..


    thanks
    Attached Files Attached Files
    Last edited by Sultix; 01-07-2012 at 12:58 AM.

  2. #2
    Valued Forum Contributor
    Join Date
    12-14-2009
    Location
    San Francisco, CA
    MS-Off Ver
    Excel 2003, 2007, 2010
    Posts
    986

    Re: Index Match with IF

    try

    =IFERROR(IF(MATCH(D4,ACCOUNT!$A$2:$A$6,0)=MATCH(E4,ACCOUNT!$B$2:$B$6),C4,IF(MATCH(DATA!E4,ACCOUNT!$B $2:$B$6,0)>0,D4,"")),"")
    Last edited by teylyn; 01-07-2012 at 12:05 AM. Reason: original post restored
    To thank someone who has helped you, click on the star icon below their name.

    I hate reading

    Portfolio

    I need a job.
    I am young and incompetent

  3. #3
    Forum Guru
    Join Date
    10-28-2008
    Location
    Not here anymore
    MS-Off Ver
    irrelevant
    Posts
    10,151

    Re: Index Match with IF

    Hello,

    You can use just one formula if you fix several problems:

    Sub Company in both sheets needs to be exactly the same text (on the Account sheet, there is a line break after Sub)
    Use relative and absolute referencing correctly (your formula had some relative references that change when the formula is copied down).

    Starting in row 4, this formula will extract the correct account number

    =INDEX(ACCOUNT!$A$2:$D$6,MATCH(DATA!E4,ACCOUNT!$B$2:$B$6,0),MATCH(DATA!F4,ACCOUNT!$A$1:$D$1,0))

    cheers,

  4. #4
    Forum Guru
    Join Date
    10-28-2008
    Location
    Not here anymore
    MS-Off Ver
    irrelevant
    Posts
    10,151

    Re: Index Match with IF

    JieJenn, did you test that? It does not return a single valid result in the spreadsheet, for obvious reasons, of course.

  5. #5
    Forum Guru
    Join Date
    10-28-2008
    Location
    Not here anymore
    MS-Off Ver
    irrelevant
    Posts
    10,151

    Re: Index Match with IF

    JieJenn, if you don't take the time to test, that's one thing. But editing your post after it has received replies will distort the flow of the discussion. Please don't do that again. Stand by your posts.

    I have restored your original post. Maybe you want to take some time for QA before posting to avoid such situations.

    thanks,

  6. #6
    Forum Guru
    Join Date
    10-28-2008
    Location
    Not here anymore
    MS-Off Ver
    irrelevant
    Posts
    10,151

    Re: Index Match with IF

    to illustrate, here's the file with the corrected text on the Accounts sheet and the formula in action.
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    08-10-2007
    Posts
    91

    Re: Index Match with IF

    Quote Originally Posted by teylyn View Post
    Hello,

    Sub Company in both sheets needs to be exactly the same text (on the Account sheet, there is a line break after Sub)
    Use relative and absolute referencing correctly (your formula had some relative references that change when the formula is copied down).

    cheers,
    No wonder, thanks for clarifying.. i will keep that in mind in future
    the formula with two matches i did at first.. it did work but only for the first column (master company), for sub company i had False error.
    Thats why i thought the formula must have been wrong, which brought me to IF's and additional indexes

    thanks alot teylyn

+ 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.2.0