+ Reply to Thread
Results 1 to 10 of 10

SUM a Dynamic Array

  1. #1
    Forum Contributor
    Join Date
    07-10-2020
    Location
    New Zealand
    MS-Off Ver
    365 personal
    Posts
    302

    SUM a Dynamic Array

    I have a Dynamic Array and I want to sum the Salary Column.

    The attached file is for illustration- there would be easier ways to get it without Dynamic Array but in the real solution I need the Dynamic Array approach.

    It is likely that more names will be added to the SourceTable.

    How does one get the total for the Salary Column.

    Thank You

    Allister
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    09-25-2015
    Location
    Milan Italy
    MS-Off Ver
    office 365
    Posts
    1,781

    Re: SUM a Dynamic Array

    J10=SUM(FILTER(t_data[Salary],H5#=t_data[Name]))

  3. #3
    Forum Contributor
    Join Date
    07-10-2020
    Location
    New Zealand
    MS-Off Ver
    365 personal
    Posts
    302

    Re: SUM a Dynamic Array

    I tried this but when I add more names to theSource Data the Total doesn't move down and I get a SPILL w error.

    Are there any other ideas ?

    Thank You

    Allister
    Last edited by AllisterB; 04-21-2021 at 04:40 PM.

  4. #4
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: SUM a Dynamic Array

    Please try

    =LET(a,t_data,b,UNIQUE(INDEX(a,,1)),c,IF(SEQUENCE(ROWS(b)+1)>ROWS(b),"Total",b),CHOOSE({1,2},c,SUMIFS(INDEX(a,,2),INDEX(a,,1),SUBSTITUTE(c,"Total","*"))))
    Attached Files Attached Files

  5. #5
    Forum Contributor
    Join Date
    07-10-2020
    Location
    New Zealand
    MS-Off Ver
    365 personal
    Posts
    302

    Re: SUM a Dynamic Array

    Thank you

    This does work in your workbook. However theCheck Column is not part of your solution. This Coloumn is representative of other Columns in the real solution that are calculations using other values on the row.. the solution I need must allow for such columns

    So again thank you for your efforts but its not quite what I need .

    Kind regards

    Allister

    However

  6. #6
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: SUM a Dynamic Array

    Maybe this?

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Dave

  7. #7
    Forum Contributor
    Join Date
    07-10-2020
    Location
    New Zealand
    MS-Off Ver
    365 personal
    Posts
    302

    Re: SUM a Dynamic Array

    Thanks Dave - but again when t-Data expands theformula to Sum stays whereit is on teh sheet and I get a #Spill Error.

  8. #8
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: SUM a Dynamic Array

    Try in H5 and fill down.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Then in J5 and fill down.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files

  9. #9
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: SUM a Dynamic Array

    Last try

    =LET(a,t_data,b,UNIQUE(INDEX(a,,1)),c,IF(SEQUENCE(ROWS(b)+1)>ROWS(b),"Total",b),CHOOSE({1,2,3},c,"",SUMIFS(INDEX(a,,2),INDEX(a,,1),SUBSTITUTE(c,"Total","*"))))
    aa.png
    Attached Files Attached Files

  10. #10
    Forum Contributor
    Join Date
    07-10-2020
    Location
    New Zealand
    MS-Off Ver
    365 personal
    Posts
    302

    Re: SUM a Dynamic Array

    Nice Solution - I think this solution might just do it.

    Thanks Bo_Ry

+ 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] Populate Dynamic Array from Cell Values and write to Dynamic Range
    By TFiske in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-22-2018, 09:09 AM
  2. [SOLVED] Looping thru arrays with dynamic names. Array1/2/3/5, how to array(Array & i) syntax?
    By graym463 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-24-2015, 10:15 AM
  3. [SOLVED] Dynamic Changing Data, Based on Criteria Store in Array, Sum array and store in Cell
    By penbeacho in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-28-2015, 10:31 AM
  4. Dynamic Row Lookup Array within Array formula
    By OLLY-7 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 07-17-2014, 04:55 PM
  5. How to Preserve a Dynamic Array When the Array is Created
    By Excel Guy 123 in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 05-09-2014, 12:50 PM
  6. Loop new messages containing a table, populate a dynamic array, paste array to Excel
    By laripa in forum Outlook Programming / VBA / Macros
    Replies: 1
    Last Post: 05-19-2013, 07:20 AM
  7. [SOLVED] Populate Listbox with all rows of a dynamic array where elements of a single array match.
    By Tayque_J_Holmes in forum Excel Programming / VBA / Macros
    Replies: 21
    Last Post: 08-07-2012, 04:54 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