+ Reply to Thread
Results 1 to 10 of 10

index match with multiple returns in alphabetical order

  1. #1
    Registered User
    Join Date
    03-08-2015
    Location
    cleveland, ohio
    MS-Off Ver
    2013
    Posts
    48

    index match with multiple returns in alphabetical order

    Hello all,

    I have been trying to figure this out for a couple of days now and cannot figure it out.

    I am using this formula to return multiple values based on the criteria i have set.

    Please Login or Register  to view this content.
    the columns on my deviations tab are Date, Name, Group, Type of deviation, approved, cancelled, added by, etc. $b$1 references the date i specify. $N$3 is the # of values to return based on my criteria.

    The problem i am having is that i cannot get it to return the values in alphabetical order. I have tried changing the row reference from column a which is the date to b which is the employee name but it doesn't change the results.

    Help Please!!

  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: index match with multiple returns in alphabetical order

    Hi.

    You're querying 1048574 rows in an array formula??

    I'm surprised just a dozen or so iterations of that formula doesn't crash your computer! Certainly adding in additional clauses to effect the alphabetical sort over that range will cause serious calculation issues.

    Do you really have data extending to the very end row of the sheet?

    Regards
    Click * below if this answer helped

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

  3. #3
    Registered User
    Join Date
    03-08-2015
    Location
    cleveland, ohio
    MS-Off Ver
    2013
    Posts
    48

    Re: index match with multiple returns in alphabetical order

    I don't have that much data YET. New data is added multiple times a day daily. Right now i'm only at 1121 rows. I haven't had any crashes yet. I sometimes have to turn off the auto calculate function and then calculate sheet when necessary. However, i am open to suggestions. I have no formal excel training. Google and YouTube are my teachers when i need to figure out how to do something.

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

    Re: index match with multiple returns in alphabetical order

    But, within an array formula (just as with other array-processing functions which do not require CTRL+SHIFT+ENTER, e.g. SUMPRODUCT, AGGREGATE, etc.) you cannot arbitrarily reference as many rows as you wish with no detriment to performance.

    Each row that you reference has to be calculated, whether beyond your last row containing data or not. So if, for example, you only have data extending as far as row 1000, then, by referencing an entire column's worth of rows, you are effectively forcing Excel to calculate more than one million rows than are actually necessary, resulting in an astonishingly resource-heavy formula. And that's just for one instance of that formula.

    With some functions, e.g. COUNTIF(S)/SUMIF(S), you can get away with referencing entire columns with no detriment to performance, though that does not apply to array formulas.

    I know you think you're "hedging your bets" by setting such an upper reference, but you're actually doing far more harm than good. Surely you can choose a suitably low, though sufficient, upper bound for the end row being referenced other than the very last row?

    Regards

  5. #5
    Registered User
    Join Date
    03-08-2015
    Location
    cleveland, ohio
    MS-Off Ver
    2013
    Posts
    48

    Re: index match with multiple returns in alphabetical order

    OK. so i can reduce the rows that i am referencing and expand if necessary in the future but i still need to know how to get the results to return in alphabetical order. Preferably with 2 separate columns of data, but 1 would do if that is the best option. Specifically i would like to alphabetize by group which is column c then by name which is column b.

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

    Re: index match with multiple returns in alphabetical order

    I chose an upper row reference of 10:

    =IF($B$1=CHOOSE({1,2},Holiday),"Holiday",IF(ROWS(B9:B$9)<=$N$3,INDEX(Deviations!B$3:B$10,MATCH(SMALL(IF(Deviations!$A$3:$A$10=$B$1,IF(Deviations!$E$3:$E$10<>"no",IF(Deviations!$F$3:$F$10<>"yes",COUNTIF(Deviations!B$3:B$10,"<"&Deviations!B$3:B$10)))),ROWS(B9:B$9)),IF(Deviations!$A$3:$A$10=$B$1,IF(Deviations!$E$3:$E$10<>"no",IF(Deviations!$F$3:$F$10<>"yes",COUNTIF(Deviations!B$3:B$10,"<"&Deviations!B$3:B$10)))),0)),""))

    By the way, how is the Named Range Holiday defined? I'm curious about your initial clause as I can't see how it could be syntactically correct, though I guess I'm missing something.

    Regards

  7. #7
    Registered User
    Join Date
    03-08-2015
    Location
    cleveland, ohio
    MS-Off Ver
    2013
    Posts
    48

    Re: index match with multiple returns in alphabetical order

    The named range "Holiday" is a list of the 2016 holidays. If the date entered into B1 is one of those dates it will return the value of "Holiday". This is just a safety feature so we don't plan stuff for Holidays as they are not working days.

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

    Re: index match with multiple returns in alphabetical order

    Quote Originally Posted by mamachrissy1028 View Post
    The named range "Holiday" is a list of the 2016 holidays. If the date entered into B1 is one of those dates it will return the value of "Holiday". This is just a safety feature so we don't plan stuff for Holidays as they are not working days.
    Actually I believe that the only condition which will lead to that initial construction returning "Holiday" is if the very first cell within the Named Range Holiday is equal to the entry in B1. All other cells within that range are redundant as far as that construction is concerned.

    Regards

  9. #9
    Registered User
    Join Date
    03-08-2015
    Location
    cleveland, ohio
    MS-Off Ver
    2013
    Posts
    48

    Re: index match with multiple returns in alphabetical order

    well crap! i didn't realize that. do you know how i can make it work then? Your formula worked splendidly! What would i change if i wanted it to sort by group then by name? Is that even possible? if not would it be possible to sort by group even though there would be multiple results under the same group?

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

    Re: index match with multiple returns in alphabetical order

    I think I can help you on these new queries, but it would be far easier if I had a workbook to use.

    It doesn't have to be your actual workbook; a greatly reduced, mocked-up one with dummy data will do, so long as you clearly outline your expected results.

    Regards

+ 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. Copy tabs names to index sheet in alphabetical order
    By cjharley1450 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-23-2015, 01:00 PM
  2. Sum of multiple Index Match returns!?
    By Spicey_888 in forum Excel General
    Replies: 6
    Last Post: 04-25-2015, 05:30 AM
  3. [SOLVED] Index-Match which does not require alphabetical sort of names
    By FivestarMac in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-07-2015, 12:39 PM
  4. [SOLVED] INDEX names in alphabetical order. Horizontally.
    By JasonNeedsHelp in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-20-2013, 11:43 AM
  5. [SOLVED] Creating a unique alphabetical list (using INDEX and MATCH functions)
    By mullahraheil in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 10-29-2013, 07:17 AM
  6. Replies: 2
    Last Post: 08-16-2012, 09:00 AM
  7. Replies: 1
    Last Post: 05-05-2005, 07:06 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