Spreadsheet: 828527d1683572004-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
 |  |  | Cash | Sales | Receivables | payables | Loans | Expenses
 |  | Cash | 1 | 0.7212022507259747 | -0.6967663143672611 | 0.2488915303124807 | 0.5702108568005168 | 0.01690322548431853
 |  | Sales | 0.7212022507259747 | 0.9999999999999999 | -0.1702374749794893 | -0.2612777779473826 | 0.8615820950604889 | 0.6162823549699186
 |  | Receivables | -0.6967663143672611 | -0.1702374749794893 | 1 | -0.8680597591505408 | -0.3533220651807518 | 0.6673747558905166
 |  | payables | 0.2488915303124807 | -0.2612777779473826 | -0.8680597591505408 | 0.9999999999999999 | 0.09497311174594807 | -0.907829357864437
 |  | Loans | 0.5702108568005168 | 0.8615820950604889 | -0.3533220651807518 | 0.09497311174594807 | 1 | 0.3309201890243523
 |  | Expenses | 0.01690322548431853 | 0.6162823549699186 | 0.6673747558905166 | -0.907829357864437 | 0.3309201890243523 | 0.9999999999999999
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.