Consulting

Results 1 to 5 of 5

Thread: amending Array MATCH formula to cope with blanks?

  1. #1
    Moderator VBAX Guru Simon Lloyd's Avatar
    Joined
    Sep 2005
    Location
    UK
    Posts
    3,003
    Location

    amending Array MATCH formula to cope with blanks?

    Hi all as per a previous post i have this formula which i fixed with ISERR: {=IF(ISERR(INDEX(Accounts,SMALL(IF(MATCH(Accounts,Accounts,0)=ROW(INDIRECT( "1:"&COUNTA(Accounts))),MATCH(Accounts,Accounts,0),""),ROW()-ROW(Accounts)+1))),"",INDEX(Accounts,SMALL(IF(MATCH(Accounts,Accounts,0)=RO W(INDIRECT("1:"&COUNTA(Accounts))),MATCH(Accounts,Accounts,0),""),ROW()-ROW(Accounts)+1)))}
    The formula works great but if the list has a gap in it all of the other values it returns when copied down show#N/A, does anyone know how to cure this?

    Regards,
    SImon
    Regards,
    Simon
    Please read this before cross posting!
    In the unlikely event you didn't get your answer here try Microsoft Office Discussion @ The Code Cage
    If I have seen further it is by standing on the shoulders of giants.
    Isaac Newton, Letter to Robert Hooke, February 5, 1675 English mathematician & physicist (1642 - 1727)

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    B1: = Accounts
    B2: =IF(ISERROR(MATCH(0,COUNTIF(B$1:B1,Accounts&""),0)),"", INDEX(IF(ISBLANK(Accounts),"",Accounts),MATCH(0,COUNTIF(B$1:B1,Ac counts&""),0))) copy B2 down, and it is an array formula

  3. #3
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Sorry my account is well and truly f*\%!d up, and so I am just going to stop responding, it has become too much like hard work.

  4. #4
    Administrator
    VP-Knowledge Base
    VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    Hi Bob,
    Your post looks OK to me.
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  5. #5
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Hi Malcolm, Look at num 2, that is totally messed.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •