+ Reply to Thread
Results 1 to 4 of 4

Match or index as alternative to too many nested if functions

  1. #1
    Registered User
    Join Date
    06-03-2011
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2007
    Posts
    12

    Match or index as alternative to too many nested if functions

    Hi guys, I have a set of data in three columns, F (text), G and H (numbers). F is sorted into column J with an array to remove blanks, and I need the other two columns to be sorted into K and L to match the correspond with their text label in F, which I’ve done with a nested formula in K1 as follows:

    =IF(J1=F$1,G$1,IF(J1=F$2,G$2,IF(J1=F$3,G$3,IF(J1=F$4,G$4,IF(J1=F$5,G$5,IF(J1=F$6,G$6,IF(J1=F$7,G$7,"")))))))

    This formula is then copied down to K7 and across into L. But as I need a lot more than 7 rows, is there an index or matching formula that would accomplish this?

    Cheers
    Last edited by macca345; 06-14-2011 at 06:47 AM.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,194

    Re: Match or index as alternative to too many nested if functions

    =IFERROR(VLOOKUP(J1,$F$1:$G$7,2,FALSE),"")

    Regards
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    06-03-2011
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: Match or index as alternative to too many nested if functions

    Hi TMShucks, I asked a bit of a variation on this question in a different thread and was told to use a match formula. Thanks for your help though, much appreciated.
    Macca

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,194

    Re: Match or index as alternative to too many nested if functions

    You're welcome. Thanks for the rep.

    Not tested:

    =IFERROR(INDEX(G$1:G$7,MATCH(J1,$F$1:$F$7,0)),"")

    vs

    =IFERROR(VLOOKUP(J1,$F$1:$G$7,2,FALSE),"")


    Your choice ;-)

    Regards
    Last edited by TMS; 06-14-2011 at 08:18 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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