+ Reply to Thread
Results 1 to 9 of 9

How to shorten formula as too many arguments

Hybrid View

  1. #1
    Registered User
    Join Date
    07-08-2014
    Location
    Reading
    MS-Off Ver
    2003
    Posts
    1

    How to shorten formula as too many arguments

    Hi,

    I am trying to reduce the length of my formula by including the "AND" function but cannot get it to work...can anyone help...

    {=IFERROR(INDEX(Download!E:E,SMALL(IF(Download!$J:$J="Dan Cooper",IF(Download!$L:$L="open",IF(Download!$M:$M>=70,IF(Download!$R:$R=A1,ROW(Download!$J:$J))))),ROWS(B$6:B6))),"")}

    Thanks!

  2. #2
    Valued Forum Contributor TheCman81's Avatar
    Join Date
    11-06-2012
    Location
    Edinburgh, UK
    MS-Off Ver
    Excel 2003, 2007, 2010, 2013
    Posts
    346

    Re: How to shorten formula as too many arguments

    Because you have multiple criterias you won't shorten it by much, to include the AND function and remove most of the IF's you can use this

    =IFERROR(INDEX(Download!E:E,SMALL(IF(AND(Download!$J:$J="Dan Cooper",Download!$L:$L="open",Download!$M:$M>=70,Download!$R:$R=A1),ROW(Download!$J:$J)),ROWS(B$6:B6))),"")
    Excel Guru in the making

    <----------If the question has been answered to your satisfication please click the Add Repuation star to the left

  3. #3
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: How to shorten formula as too many arguments

    Quote Originally Posted by TheCman81 View Post
    Because you have multiple criterias you won't shorten it by much, to include the AND function and remove most of the IF's you can use this

    =IFERROR(INDEX(Download!E:E,SMALL(IF(AND(Download!$J:$J="Dan Cooper",Download!$L:$L="open",Download!$M:$M>=70,Download!$R:$R=A1),ROW(Download!$J:$J)),ROWS(B$6:B6))),"")
    That won't work.

    The AND function returns a single result where you need an array.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  4. #4
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: How to shorten formula as too many arguments

    Not sure what you're wanting to do.

    As is, and for what the formula is doing, there's not much to shorten.

    One thing that can help make the formula more efficient is to not use the entire columns as range references. Use smaller specific ranges. Array formulas evaluate every cell that they reference. So, your formula is evaluating over 5 million cells and that takes a bit of time!

  5. #5
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: How to shorten formula as too many arguments

    Couldn't really test this formula so, just give it a try. I've set ranges from row 6 to row 200 so you can adjust them.

    Formula: copy to clipboard
    =IFERROR(INDEX(Download!E:E,SMALL(IF((Download!$J$6:$J$200="Dan Cooper")*(Download!$L$6:$L$200="open")*(Download!$M$6:$M$200>=70)*(Download!$R$6:$R$200=A1),ROW(Download!$J$6:$J$200)),ROWS(B$6:B6))),"")


    ...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer. Press F2 on that cell and try again.
    Last edited by AlKey; 07-08-2014 at 10:22 AM.
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  6. #6
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: How to shorten formula as too many arguments

    Quote Originally Posted by AlKey View Post

    =IFERROR(INDEX(Download!E:E,SMALL(IF((Download!$J$6:$J$200="Dan Cooper")*(Download!$L$6:$L$200="open")*(Download!$M$6:$M$200>=70)*(Download!$R$6:$R$200=A1),ROW(Download!$J$2:$J$200)),ROWS(B$6:B6))),"")
    The ROW function uses a different sized range.

    So, by replacing the IF functions with array multiplication you shortened the formula by 4 keystrokes!

  7. #7
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: How to shorten formula as too many arguments

    Quote Originally Posted by Tony Valko View Post
    The ROW function uses a different sized range.

    So, by replacing the IF functions with array multiplication you shortened the formula by 4 keystrokes!
    Well, don't forget I set static ranges which added few keystrokes. I think it can be reduced from ROWS(B$6:B6) to ROW(1:1) = 3 less)

    Thanks Tony, this has been corrected "ROW(Download!$J$2:$J$200)"
    Last edited by AlKey; 07-08-2014 at 10:24 AM.

  8. #8
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: How to shorten formula as too many arguments

    Quote Originally Posted by AlKey View Post
    I think it can be reduced from ROWS(B$6:B6) to ROW(1:1) = 3 less
    Yeah, but then that leaves the formula vulnerable to new row insertions.

  9. #9
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: How to shorten formula as too many arguments

    Quote Originally Posted by Tony Valko View Post
    Yeah, but then that leaves the formula vulnerable to new row insertions.
    That was only to reduce character count

+ 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. way to shorten this formula?
    By tsiguy96 in forum Excel General
    Replies: 2
    Last Post: 04-03-2012, 08:28 PM
  2. Shorten a formula
    By asburytl in forum Excel General
    Replies: 2
    Last Post: 09-02-2011, 10:47 AM
  3. formula to shorten if need be
    By excellentexcel in forum Excel General
    Replies: 3
    Last Post: 03-04-2009, 01:50 PM
  4. shorten formula
    By PACable in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 10-26-2005, 08:05 PM
  5. Trying to shorten (or use new) formula
    By Monk in forum Excel General
    Replies: 1
    Last Post: 06-29-2005, 02:05 PM

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