Spreadsheet: 828420d1683477886-what-is-the-right-arguments-as-an-array-to-calculate-correlation-for-a-lot-of-variables-updateheader-2nd-5throws
Sheet: Sheet1

1st
 | This is the main table that contains my data, so I've gave it a name "Main Table", but this name of course does not includes the header row.
 | And also set a defined name "EntireMainTable" to include the header row as well.
 | No. | Item | 2016 | 2017 | 2018 | 2019 | 2020 | 2021 | 2022
 | 1 | Cash | 586659031 | 480343056 | 20473172 | 605840237 | 322747307.5 | 282514680.9 | 242282054.3
 | 2 | Sales | 759051269 | 498365688 | 395887621 | 554353871 | 372772047 | 301115020.9 | 229457994.8
 | 3 | Receivables | 554603731 | 413440842 | 653946455 | 484659284 | 534330646 | 537397873.2 | 540465100.4
 | 4 | payables | 102298199 | 858026168 | 111387132 | 410342401 | 414886867.5 | 432636224.5 | 450385581.5
 | 5 | Loans | 826522204 | 873292758 | 320363304 | 389108069 | 136028619 | -50488566.8999999 | -237005752.8
 | 6 | Expenses | 722623185 | 34417935 | 579008782 | 333651085 | 261843883.5 | 199611338.2 | 137378792.9
2nd
 | Now if I want to copy the entire table and let the copy got updated automatically, I use the formula =EntireMainTable
 |  | Item | 2016 | 2017 | 2018 | 2019 | 2020 | 2021 | 2022
 | 1 | Cash | 586659031 | 480343056 | 20473172 | 605840237 | 322747307.5 | 282514680.9 | 242282054.3
 | 2 | Sales | 759051269 | 498365688 | 395887621 | 554353871 | 372772047 | 301115020.9 | 229457994.8
 | 3 | Receivables | 554603731 | 413440842 | 653946455 | 484659284 | 534330646 | 537397873.2 | 540465100.4
 | 4 | payables | 102298199 | 858026168 | 111387132 | 410342401 | 414886867.5 | 432636224.5 | 450385581.5
 | 5 | Loans | 826522204 | 873292758 | 320363304 | 389108069 | 136028619 | -50488566.8999999 | -237005752.8
 | 6 | Expenses | 722623185 | 34417935 | 579008782 | 333651085 | 261843883.5 | 199611338.2 | 137378792.9
3rd - When the table got updated
 | Now I want to copy only the header and the 2nd and 5th rows of that table, but also want if the table got updated by adding new columns for new years like 2020 …etc. I want the new added data to be copied automatically.
 | No. | Item | 2016 | 2017 | 2018 | 2019 | 2020
 | 1 | Cash | 586659031 | 480343056 | 20473172 | 605840237 | 322747307.5
 | 2 | Sales | 759051269 | 498365688 | 395887621 | 554353871 | 372772047
 | 3 | Receivables | 554603731 | 413440842 | 653946455 | 484659284 | 534330646
 | 4 | payables | 102298199 | 858026168 | 111387132 | 410342401 | 414886867.5
 | 5 | Loans | 826522204 | 873292758 | 320363304 | 389108069 | 136028619
 | 6 | Expenses | 722623185 | 34417935 | 579008782 | 333651085 | 261843883.5
4th - I want the copy to be updated automatically, copy only the header and the 2nd and 5th rows of that table
 | How to only copy the header, 2nd, and 5th rows, and include column 2020, and if more columns added later on to be included
 | I've tried to add a defined names for header, 2nd row, and 5th row, but it did not got updated except for header
 | No. | Item | 2016 | 2017 | 2018 | 2019 | 2020
 | 1 | Cash | 586659031 | 480343056 | 20473172 | 605840237 | 322747307.5
 | 2 | Sales | 759051269 | 498365688 | 395887621 | 554353871 | 372772047
 | 3 | Receivables | 554603731 | 413440842 | 653946455 | 484659284 | 534330646
 | 4 | payables | 102298199 | 858026168 | 111387132 | 410342401 | 414886867.5
 | 5 | Loans | 826522204 | 873292758 | 320363304 | 389108069 | 136028619
 | 6 | Expenses | 722623185 | 34417935 | 579008782 | 333651085 | 261843883.5
5th - Only the header worked! | I was not able to make a dynamic updated range for 2nd, and 5th rows
 |  | Item | 2016 | 2017 | 2018 | 2019 | 2020
Previous Solution
Current Task
Calculate correlation
 |  | Correlation | Cash | Sales | Receivables | payables | Loans | Expenses
 |  | Cash
 |  | Sales
 |  | Receivables
 |  | payables
 |  | Loans
 |  | Expenses
1- | Now the question is: how to write the formula correctly in the CorrelationTable?
2- | The formula should be filled in 1st in D56, then dragged across rows and columns, so what is the right formula?
3- | The formula should take later on years updates into consideration, I mean when year 2023 values being added or updated?
So what is the right formula that achieve these 3 conditions?
I tried to apply or adjust the formula in B49 but failed to adjust it.