+ Reply to Thread
Results 1 to 12 of 12

Spill Array Syntax

  1. #1
    Registered User
    Join Date
    05-14-2009
    Location
    Ontario, Canada
    MS-Off Ver
    365
    Posts
    24

    Spill Array Syntax

    Hello,

    I am using Excel 365 and I am trying to have a user filter data and display specific columns of data with sums. Note that the data is one line per record and I wish to sum it. Not sure if this requires a "let" statement.

    The worksheet screenshot below shows the fields that the user can select. Either a valid value in the drop down or "all".

    Untitled.jpg

    The code below works to filter the dataset as I would like:
    Please Login or Register  to view this content.
    The "columns" noted above are also drop down and the numbers represent the column number for dynamic use of ChooseCols() or whatever other syntax is required. Below is what I wish the table to look like. Note that the "etc" is only to save time, I would want real results to represent whatever days are applicable. Please advise how I create a spill array to create the desired result. Thanks very much.

    table_results.jpg

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,959

    Re: Spill Array Syntax

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however it has been brought to our attention that the same query has been posted on one or more other forums and you have not told us about this. You are required to do so. Cross-posts are allowed but you must provide a link to your posts on other sites.
    For new members: you will not be able to post a full URL, so remove the https://www. section and add one or two breaks to the rest of the address. A Moderator or Admin will then fix the link for you.

    Please see Forum Rule #7 about cross-posting and adjust accordingly. Read this to understand why we (and other sites like us) consider this to be important: https://excelguru.ca/a-message-to-forum-cross-posters/

    (Note: this requirement is not optional. No help to be offered until you provide a link or, for members with fewer than 10 posts, a comment telling us where else you have posted this query.)
    Jeff
    | | |·| |·| |·| |·| | |:| | |·| |·|
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    05-14-2009
    Location
    Ontario, Canada
    MS-Off Ver
    365
    Posts
    24

    Re: Spill Array Syntax

    Hello,

    Sorry about that. I wasn't sure if the addition to the post on Mr. Excel was being considered based on the response I got but I totally understand needing to know about it. The link is here: https://www.mrexcel.com/board/thread...tance.1270598/

    Thanks.
    Last edited by AliGW; 03-16-2025 at 01:55 AM. Reason: URL fixed.

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    90,903

    Re: Spill Array Syntax

    If you still need help, please attach a sample workbook - we can't test anything using screenshots.

    Please update your forum profile from 2010 to 365.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  5. #5
    Registered User
    Join Date
    05-14-2009
    Location
    Ontario, Canada
    MS-Off Ver
    365
    Posts
    24

    Re: Spill Array Syntax

    Hello,

    I've prepared a sample workbook but how do I attach it to this thread? Thanks.

    Shelley

  6. #6
    Registered User
    Join Date
    05-14-2009
    Location
    Ontario, Canada
    MS-Off Ver
    365
    Posts
    24

    Re: Spill Array Syntax

    Please see attached.
    Attached Files Attached Files

  7. #7
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,959

    Re: Spill Array Syntax

    Thanks for attaching your file, that's very helpful.

    The description in your post is a bit different than what I see in the file, but I think from context I get what you want to do.

    This hinges on being able to make the columns to display dynamic. I don't know if you can do that with CHOOSECOLS. I'll have to poke into that a bit.

  8. #8
    Registered User
    Join Date
    05-14-2009
    Location
    Ontario, Canada
    MS-Off Ver
    365
    Posts
    24

    Re: Spill Array Syntax

    Hello,

    Yes, you can use ChooseCols() which is what I've done and pointed to the "columns" of the 3 items selected (C13, C15, C17 on summary tab). But maybe choosecols() isn't what is best to use? I did a "let" statement once where the data was one row per data and was able to summarize to get cases based on the groups I wanted but it was hard coded and not dynamic. I also don't know how to work the filter into the "let" statement.

    To recap, the filter for the items on the summary page of D4:D8, H4:H8 and K4:K8 is working as I would like. The dynamic choosecols() is working. The only thing that I can't figure out is how to summarize the data and not just show the single record. Not sure if the "notes" worksheet is of any assistance to you but I outline the info there.

    Thanks so much for any assistance you can provide and please don't hesitate to ask me anything. Also, don't hesitate to suggest another approach if it works better.
    Last edited by coolchick; 03-17-2025 at 12:09 AM.

  9. #9
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    90,903

    Re: Spill Array Syntax

    Is this what you want?

    Please Login or Register  to view this content.

  10. #10
    Registered User
    Join Date
    05-14-2009
    Location
    Ontario, Canada
    MS-Off Ver
    365
    Posts
    24

    Re: Spill Array Syntax

    You are brilliant!! Thank you so much, this is exactly what I wanted!!

  11. #11
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    90,903

    Re: Spill Array Syntax

    Glad to have helped.

    If that takes care of your original question, please choose Thread Tools from the menu link above and mark this thread as SOLVED. You can also access the SOLVED tag by editing the opening post and choosing SOLVED from the drop-down to the left of the title box.

    Also, if you have not already done so, remember that you can reward anyone who offered you help towards a solution for your issue by clicking the small star icon (* Add Reputation) located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of each of those who offered help.

  12. #12
    Forum Contributor
    Join Date
    08-19-2024
    Location
    Philippines
    MS-Off Ver
    MS365 for Business
    Posts
    113

    Re: Spill Array Syntax

    As a tip, the formula could be cleaned up a bit by first defining a custom function for the "include" criteria to simply return a pre-constructed vector of 1's the same length as the fields being evaluated when "All" is selected. For example:
    Please Login or Register  to view this content.
    Also, XMATCH was used with TOROW on the selected columns range to return the column numbers for CHOOSECOLS dynamically. This eliminates the need for helper columns F & K on the Summary worksheet. See attached...
    Attached Files Attached Files
    Last edited by djclements; 03-19-2025 at 07:22 PM. Reason: Simplified table column references in the [filter_array].

+ 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. [SOLVED] How to add OR criteria in Spill Array
    By MubiJazz in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 07-31-2024, 03:53 AM
  2. Array !SPILL error on array formula
    By AlienDuck in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-15-2024, 10:20 AM
  3. Formula on a Spill Array
    By elischwa in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 05-09-2023, 10:07 AM
  4. [SOLVED] 2D Spill array
    By Glenn Kennedy in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 10-25-2022, 07:02 AM
  5. [SOLVED] COUNT Dynamic Array based on Date to return Dynamic Array Spill Range
    By dluhut in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 05-06-2022, 01:14 PM
  6. [SOLVED] RETURN FVSCHEDULE as a SPILL ARRAY
    By James McEwan in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-20-2021, 01:22 PM
  7. Spill array starting from zero
    By Sordini2 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-14-2021, 09:37 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