Table of contents
1 Raw material: such a region + tool if({1,0,0}) array formula
1.2 Principle if(0/1,t-value,f-value)---deformation--->if({},range1,range2)
1.2.1 if (0/1, t-value, f-value) --- deformation ---> if ({}, range1, range2)
1.2.4 Principle 3: {} row-column matrix principle
2 Realize column swap order + combine columns
4 can be output as 3 columns, 4 columns, more columns
5 if nested, can judge multiple times
6 You can also specify row and column
1 Raw material: such a region + tool if({1,0,0}) array formula
1.1 Raw data
1.2 Principle if(0/1,t-value,f-value)---deformation--->if({},range1,range2)
1.2.1 if (0/1, t-value, f-value) --- deformation ---> if ({}, range1, range2)
- The core is to use the if function + array to let the if judge multiple times, generate a new array and output it to the new area
1.2.2 Principle 1: The principle of if array, although if() can only judge once and output one result, but if({}) is if()+array, it can make multiple judgments and output multiple results
- if(0/1,t-value,f-value) can only output 1 t-value/f-value
- But if({}, range1, range2) can make multiple judgments
- The number of judgments depends on the number of elements in {1,0...1}, if there are several, you can judge and output several times
- First judge the first element in the array, and then in order. . . .
1.2.3 Principle 2, change the bool value mapping result to the range: truevalue and false-value correspond to the range respectively, so if({}, range1, range2) realizes the reorganization of the range.
- In fact, it's a one-handed transfer
- Bool is worth judging the result, regardless of 0/1, it corresponds to an area
- For example, if you want to apply vlookup(if{1,0...}), the first element of the array must be 1 and not 0, because vlookup must be searched based on the first column, even if it is the area after reorganization
1.2.4 Principle 3: {} row-column matrix principle
- {}, separate rows, ; separate columns
- In this way, if can expand a given area/row/column into an arbitrary matrix form in the form of an array!
- The complete row and column form {i11,i12,i13;i21,i22,i23; ....} is a proper matrix
- It is to design several rows and columns, and each row and column can specify the position corresponding to true, and the other cases are false
2 Realize column swap order + combine columns
- The writing method is if({1,0}) if({1,0,1,1}) etc.
- Separated by commas are all columns
- Use semicolons; to separate lines
- You can also directly combine some columns &, the output is 1 new column
3 row swap order
- It does not need to be adjacent lines
4 can be output as 3 columns, 4 columns, more columns
- Although if can only have the 2-element judgment of 0/1, the array {1,0,0,1} theoretically can set up any number of areas.
- The array {1,0,0,1} determines the number of output columns, which can be set arbitrarily, for example, it can also be output as 4 areas
5 if nested, can judge multiple times
- Although if can only have a 2-element judgment of 0/1, how many times do you have to judge? You can do multi-layer if nesting
- Realize the scrambling and reordering of 3 columns
- The array {1,0,0,1} determines the number of output columns, which can be set arbitrarily, for example, it can also be output as 4 areas
6 You can also specify row and column
- combination of rows and columns
- A bit, the taste of the matrix, is to design several rows and columns,
- The specified position of each row and column is true, and the others are false
- But because the original array is 3*3, i4, 4 cannot be retrieved, so it is na