+ Reply to Thread
Results 1 to 8 of 8

Can annyone simplify this function?

  1. #1
    Registered User
    Join Date
    02-02-2009
    Location
    AUS
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    3

    Can annyone simplify this function?

    Hi i really need help, this formula basically represents a multiple lookup function. So I and looking for a code in 1 of 3 different collumns. But it just seems like to much overkill? Any suggestions for shortening it? Would really appreciate it.

    #IF(ISERROR(IF(ISERROR(INDEX(Roster!$A$6:$A$21,MATCH('Pay Sheet fn 1'!B6,Roster!$C$6:$C$21,0))),(INDEX(Roster!$A$6:$A$21,MATCH('Pay Sheet fn 1'!B6,Roster!$D$6:$D$21,0))),(INDEX(Roster!$A$6:$A$21,MATCH('Pay Sheet fn 1'!B6,Roster!$C$6:$C$21,0))))),(INDEX(Roster!$A$6:$A$21,MATCH('Pay Sheet fn 1'!B6,Roster!$E$6:$E$21,0))),IF(ISERROR(INDEX(Roster!$A$6:$A$21,MATCH('Pay Sheet fn 1'!B6,Roster!$C$6:$C$21,0))),(INDEX(Roster!$A$6:$A$21,MATCH('Pay Sheet fn 1'!B6,Roster!$D$6:$D$21,0))),(INDEX(Roster!$A$6:$A$21,MATCH('Pay Sheet fn 1'!B6,Roster!$C$6:$C$21,0)))))#

    this relates to a post from a couple of weeks ago
    http://www.excelforum.com/excel-gene...ml#post2037422

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Can annyone simplify this function?

    What is the data type of the value being returned from Roster Column A - text/number etc ?

    Could the lookup value be found in multiple columns at any one time or is it only ever once (or not at all)

  3. #3
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Can annyone simplify this function?

    Incidentally referring to your old post... the following in B16 would have worked I think:

    Please Login or Register  to view this content.
    For subsequent days the columns B:E would need to be altered to F:I etc...

    Not easier mind...

    There will be better methods... just need to think...

  4. #4
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Can annyone simplify this function?

    usually you can shorten it by replacing the whole index/match test with just match
    IF(ISERROR(MATCH('Pay Sheet fn 1'!B6,Roster!$C$6:$C$21,0))
    or turn it around with if(isnumber(
    IF(Is number(MATCH('Pay Sheet fn 1'!B6,Roster!$C$6:$C$21,0))
    which is easier to string together

  5. #5
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Can annyone simplify this function?

    This isn't pretty....

    Please Login or Register  to view this content.

    ...but, does it help?

    EDITED TO INCLUDE THIS SHORTER FORMULA:
    I'm no fan of INDIRECT but....maybe it's ok in this case:

    Please Login or Register  to view this content.
    (I attached a sample file)

    Does that help?
    Attached Files Attached Files
    Last edited by Ron Coderre; 02-17-2009 at 06:27 PM. Reason: Include a better formula and attach a sample file
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  6. #6
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Can annyone simplify this function?

    Another possibly simpler (??) version re: your old Q ... this assumes 1 match only per day

    B16:

    Please Login or Register  to view this content.
    As per the other for each day you would need to alter the column references such that B:E becomes F:I etc...

  7. #7
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Can annyone simplify this function?

    Note: I added an alternative formula to that post.

  8. #8
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Can annyone simplify this function?

    So this is a different layout to the original?

    For your original question you could use this formula in B16, confirmed with CTRL+SHIFT+ENTER and copied across and down to F23

    =LOOKUP("zzz",CHOOSE({1,2},"",INDEX($A$5:$A$11,SMALL(IF(OFFSET($B$5:$E$11,0,MATCH(B$15&"*",$B$3:$U$3,0)-1)=$A16,ROW($B$5:$E$11)-ROW($B$5)+1),1))))

    see attached

    Note: formula revised to return blank when initials don't exist for that day, using similar method to DonkeyOte's......
    Attached Files Attached Files
    Last edited by daddylonglegs; 02-17-2009 at 06:11 PM.

+ 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.6.0 RC 1