Jak połączyć zakresy w arkuszach kalkulacyjnych google

[[4]] chcę mieć wszystkie arkusze kalkulacyjne Google.

Przykład

Sheet1!A: A

{12, 131, 45}

Sheet2!A: A

{12, 131, 46}

nieznana funkcja

=formula_for_union_range(Sheet1!A:A; Sheet2!:A:A)

should return

{12, 131, 45, 12, 131, 46}

Pytanie

Jak to możliwe?
Author: oshliaer, 2012-05-29

6 answers

Możesz połączyć je w 1 kolumnę, a następnie uzyskać unikalne wartości. Sprawdź następującą formułę:

=UNIQUE({Sheet1!A:A;Sheet2!A:A})
 51
Author: Passant El.Agroudy,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2017-04-13 16:11:20

Po prostu użyj:

={sheet1!a:a; sheet2!a:a}
 31
Author: mik,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2016-06-06 08:37:13

Chociaż skrypt może to zrobić łatwo, zalecam stosowanie zwykłych formuł arkusza kalkulacyjnego, np.]}

=transpose(split(join(";";Sheet1!A:A)&";"&join(";";Sheet2!A:A);";"))

Aby usunąć duplikaty, wystarczy zawinąć je w unique wzór:

=unique(transpose(...))

I do sortowania... =sort(...)

 20
Author: Henrique G. Abreu,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2014-08-11 11:59:40

Google Apps Script

A jednak pytanie dotyczyło scenariusza. Nadal z powodzeniem używam następującego kodu:

function unionRanges(e) {
  var result = [];
  var length = 0;
  var i = 0;
  try {
    for (i = 0; i < arguments.length; i++)
      length += arguments[i].length;
    if (length > 3000) return '#BIGRANGE';
    for (var i = 0; i < arguments.length; i++)
      result = result.concat(arguments[i].filter(function (el) {
        return el.join('').length > 0
      }));
    return result;
  } catch (err) {
    return JSON.stringify(err);
  }
}

Funkcja arkuszy kalkulacyjnych

Ale, jak wspomniano powyżej, łatwiej jest użyć {} - notacji.

Konkatenacja pionowa

={Range(Cols=N);Range(Cols=N)}

Konkatenacja pozioma

={Range(Row=M),Range(Rows=M)}

Możliwe jest łączenie

={{,,};{,,}}

Albo coś trudniejszego

={{;;},{;;}};{{;;},{;;}};{{;;},{;;}}

Arkusz 'Data 1'!A1:C20

|   Name  |    Date   | Sum |
| Ethan   |  3/4/2017 |  31 |
| Logan   |  3/6/2017 |  62 |
| Brian   | 3/26/2017 |  61 |
|   ...   |     ...   | ... |

Arkusz 'Data 2'!A1:C20

|  Name   |    Date   | Sum |
| Nathan  | 3/30/2017 |  53 |
| Alyssa  | 3/13/2017 |  72 |
| John    | 3/24/2017 |  79 |
| Megan   | 3/16/2017 |  10 |
|   ...   |     ...   | ... |

Konkatenacja

Konkatenacja pionowa

={'Data 1'!A1:C20;'Data 2'!A2:C20}
Wynik
|  Name  |    Date   | Sum |
| Ethan  |  3/4/2017 |  31 |
| Logan  |  3/6/2017 |  62 |
| Brian  | 3/26/2017 |  61 |
| ...    |       ... | ... |
| Nathan | 3/30/2017 |  53 |
| Alyssa | 3/13/2017 |  72 |
| John   | 3/24/2017 |  79 |
| ...    |       ... | ... |

Konkatenacja pozioma

={TRANSPOSE('Data 1'!A1:C20),TRANSPOSE('Data 2'!A2:C20)}
Wynik
| Name |   Ethan  |   Logan  |   Brian   | ... |   Nathan  |   Alyssa  |    John   |
| Date | 3/4/2017 | 3/6/2017 | 3/26/2017 | ... | 3/30/2017 | 3/13/2017 | 3/24/2017 |
| Sum  |       31 |       62 |        61 | ... |        53 |        72 |        79 |

Więcej o tym Jak konkatenować zakresy w arkuszach kalkulacyjnych Google

 6
Author: oshliaer,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2017-07-26 11:40:16

Jeśli chcesz połączyć arkusze i wykluczyć wiersze z pustymi komórkami, użyj funkcji Filtr w Formule:

=FILTER({Sheet1!A:A;Sheet2!A:A}, {Sheet1!A:A;Sheet2!A:A}<>"")
 0
Author: mgig,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2018-07-09 04:10:24

Załóżmy, że masz:

   A    B   C   D   E   F
1: 1    2   3   4   5   6

Możliwe jest łączenie plastrów jako wierszy lub kolumn.

Dla dodatkowych kolumn (ten sam wiersz), użyj przecinka. ={$A1:$C1,$D1:$F1}

1   2   3   4   5   6

Dla dodatkowych wierszy (tych samych kolumn) użyj średnika. ={$A1:$C1;$D1:$F1}

1   2   3
4   5   6
 0
Author: jbryanscott,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2018-07-25 21:49:10