+ Reply to Thread
Results 1 to 17 of 17

Is there a better way than an array formula for this formula?

  1. #1
    Forum Contributor
    Join Date
    04-02-2010
    Location
    penrith
    MS-Off Ver
    Excel 2007
    Posts
    522

    Is there a better way than an array formula for this formula?

    Hi, I have a formula

    {=IFERROR(INDEX($D$2:$D$5010,MATCH(0,COUNTIF(E2:$E$2,$D$2:$D$5010)+IF(COUNTIF($D$2:$D$5010,$D$2:$D$5010)>=1,0,1),0)),"")}

    The formula looks at a named range OWNING and creates a unique distinct list from several duplicates.

    Is there a way to do this without an array as it is slowing the sheet dramatically.

    KEY :

    The D range refers to list of entered duplicate names D10:D5010

    E is the column the unique list is displayed in.

    Thanks in advance

  2. #2
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Is there a better way than an array formula for this formula?

    I'm not an expert in calcuation optimisation, though COUNTIF can be a little sluggish so you might want to test this alternative array formula with FREQUENCY:

    =IFERROR(INDEX($D$2:$D$5010,SMALL(IF(FREQUENCY(IF($D$2:$D$5010<>"",MATCH($D$2:$D$5010,$D$2:$D$5010,0)),ROW($D$2:$D$5010)-MIN(ROW($D$2:$D$5010))+1),ROW($D$2:$D$5010)-MIN(ROW($D$2:$D$5010))+1),ROWS($1:1))),"")

    Regards
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  3. #3
    Forum Expert
    Join Date
    02-19-2013
    Location
    India
    MS-Off Ver
    07/16
    Posts
    2,386

    Re: Is there a better way than an array formula for this formula?

    Hello John Try below in e2 and drag down
    non array
    =IFERROR(INDEX($D$2:$D$5010,MATCH(0,INDEX(COUNTIF($E$1:E1,$D$2:$D$5010),0),0)),"")
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    WANT TO SAY THANKS, HIT ADD REPUTATION (*) AT THE BOTTOM LEFT CORNER OF THE POST

    More we learn about excel, more it shows us, how less we know about it.

    for chemistry
    https://www.youtube.com/c/chemistrybyshivaansh

  4. #4
    Forum Contributor
    Join Date
    04-02-2010
    Location
    penrith
    MS-Off Ver
    Excel 2007
    Posts
    522

    Re: Is there a better way than an array formula for this formula?

    Hi, Cant get it to work for some reason.
    Last edited by john dalton; 03-12-2014 at 06:43 AM. Reason: grammar

  5. #5
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Is there a better way than an array formula for this formula?

    For some reason that isn't enough information to help you further.

    Regards

  6. #6
    Forum Contributor
    Join Date
    04-02-2010
    Location
    penrith
    MS-Off Ver
    Excel 2007
    Posts
    522

    Re: Is there a better way than an array formula for this formula?

    Brilliant, there is a zero appears in the cell underneath the last found name in the list anyway of stopping this happening?

    Cheers

  7. #7
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Is there a better way than an array formula for this formula?

    Perhaps you should clarify to whose solution you are referring?

  8. #8
    Forum Contributor
    Join Date
    04-02-2010
    Location
    penrith
    MS-Off Ver
    Excel 2007
    Posts
    522

    Re: Is there a better way than an array formula for this formula?

    Sorry XOR LX, I was referring to Hemesh's solution.

  9. #9
    Forum Expert
    Join Date
    02-19-2013
    Location
    India
    MS-Off Ver
    07/16
    Posts
    2,386

    Re: Is there a better way than an array formula for this formula?

    DO you have any blanks in between or does your range has empty cells at the end ?

  10. #10
    Forum Contributor
    Join Date
    04-02-2010
    Location
    penrith
    MS-Off Ver
    Excel 2007
    Posts
    522

    Re: Is there a better way than an array formula for this formula?

    Empty cells at the end.

  11. #11
    Forum Expert
    Join Date
    02-19-2013
    Location
    India
    MS-Off Ver
    07/16
    Posts
    2,386

    Re: Is there a better way than an array formula for this formula?

    don't take empty cells in the range

  12. #12
    Forum Contributor
    Join Date
    04-02-2010
    Location
    penrith
    MS-Off Ver
    Excel 2007
    Posts
    522

    Re: Is there a better way than an array formula for this formula?

    The list is a data entry list, is there a a way to limit the range if it finds the next empty cell and just calculates upto the the last actual entry point?

  13. #13
    Forum Expert
    Join Date
    02-19-2013
    Location
    India
    MS-Off Ver
    07/16
    Posts
    2,386

    Re: Is there a better way than an array formula for this formula?

    yes you can do the same try below
    =IFERROR(INDEX($D$2:$D$7000,MATCH(0,INDEX(COUNTIF($F$1:F1,$D$2:INDEX($D$2:$D$5010,COUNTA($D$2:$D$7000))),0),0)),"") in e2 and drag down it will dynamically pick the last entry point up to 7000 rows. I think there are only text entries in Column D

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

    Re: Is there a better way than an array formula for this formula?

    What's slowing down your file is this:

    +IF(COUNTIF($D$2:$D$5010,$D$2:$D$5010)>=1,0,1)

    Not sure why it's there.

    While the suggestion in post #3 is an improvement, it also has to be noted that simply adding another INDEX function to avoid array entry does not make the formula more efficient. What made the formula more efficient was removing the above IF function.

    I see this all the time. There's a lot of misinformation on this site!

    People are "deathly" afraid of using volatile functions and array formulas due to the spread of this misinformation.

    Your mileage may vary!
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  15. #15
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Is there a better way than an array formula for this formula?

    Excellent words, Tony. Should be made a 'sticky' in my opinion.

    I remember an OP once asking me if I could provide an alternative, non-array solution as he'd heard that array formulas could 'corrupt' a worksheet!!

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

    Re: Is there a better way than an array formula for this formula?

    I usually "hold my tongue" when I see these things as I don't want to start any arguments but today I just had to "snap out"!

  17. #17
    Forum Contributor
    Join Date
    04-02-2010
    Location
    penrith
    MS-Off Ver
    Excel 2007
    Posts
    522

    Re: Is there a better way than an array formula for this formula?

    Thanks guys I have got the formula working, some interesting varitaions for future sheets.

    Thanks again.

    JD

+ 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. Array formula + Array formula with criteria that lookups a Table
    By anrichards22 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-16-2013, 11:41 AM
  2. VBA Macro: Plugging an Array-Formula into a Cell and Dragging Formula Down Columns
    By Brianandstewie in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-20-2013, 02:57 PM
  3. Replies: 2
    Last Post: 06-20-2012, 12:22 PM
  4. [SOLVED] Stumped with Formula Array returning cell adjacent to formula dataset
    By Giles_Silver in forum Excel General
    Replies: 5
    Last Post: 06-04-2012, 12:18 AM
  5. [SOLVED] Tricky array formula issue - Using array formula on one cell, then autofilling down a range
    By aspenbordr in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-27-2005, 11:05 AM

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