web-dev-qa-db-fra.com

Générer une séquence personnalisée dans Google Sheets

Je voudrais créer une colonne avec une séquence personnalisée: A-Z,a-z,0-9. (Essentiellement jeu de caractères Base64 avec les deux derniers caractères, + et /, laissé de côté) Donc, A1 serait AAA, A2 serait AAB ... continuant vers AAZ, AAa, ..., AA8, AA9, ABA, ABB etc.

Notez que AAA serait numériquement le même que A (tous deux égaux à 0), mais je dois garder le même nombre de chiffres sur toute la séquence.

Faire cela avec seulement des chiffres est simple: =A1+1 et copiez-le tout le long de la colonne.

Existe-t-il un moyen simple et efficace de le faire dans des feuilles (peut-être utiliser une formule matricielle?) Ou en utilisant une fonction? Je devrai passer au moins à 40000 itérations (40000 = KZK, si j'ai fait le calcul correctement).

Finalement, cela ressemblera à ceci:

article_AAA

article_AAB

article_AAC

...

article_KZI

article_KZJ

article_KZK

Je ne suis pas très mathématicien, mais je pense que ce site pourrait aider: https://www.dcode.fr/base-n-convert

1
Joe
=ARRAYFORMULA(REGEXREPLACE(TRANSPOSE(QUERY(TRANSPOSE((CHAR({{
 TRANSPOSE(SPLIT(    TEXTJOIN(",",1,REPT(ROW(INDIRECT("A"&65&":A"&68))&",",3844)),","));
 TRANSPOSE(SPLIT(","&TEXTJOIN(",",1,REPT(ROW(INDIRECT("A"&69&":A"&72))&",",3844)),","));
 TRANSPOSE(SPLIT(","&TEXTJOIN(",",1,REPT(ROW(INDIRECT("A"&73&":A"&74))&",",3844)),","));
 TRANSPOSE(SPLIT(","&TEXTJOIN(",",1,REPT(75&",",1561)),","))},{
 TRANSPOSE(SPLIT(REPT(TEXTJOIN(",",1,REPT({ROW(INDIRECT("A"&65&":A"&90))&",";
        ROW(INDIRECT("A"&97&":A"&122))&",";ROW(INDIRECT("A"&48&":A"&57))&","},62)),2),","));
 TRANSPOSE(SPLIT(REPT(TEXTJOIN(",",1,REPT({ROW(INDIRECT("A"&65&":A"&90))&",";
        ROW(INDIRECT("A"&97&":A"&122))&",";ROW(INDIRECT("A"&48&":A"&57))&","},62)),2),","));
 TRANSPOSE(SPLIT(REPT(TEXTJOIN(",",1,REPT({ROW(INDIRECT("A"&65&":A"&90))&",";
        ROW(INDIRECT("A"&97&":A"&122))&",";ROW(INDIRECT("A"&48&":A"&57))&","},62)),2),","));
 TRANSPOSE(SPLIT(REPT(TEXTJOIN(",",1,REPT({ROW(INDIRECT("A"&65&":A"&90))&",";
        ROW(INDIRECT("A"&97&":A"&122))&",";ROW(INDIRECT("A"&48&":A"&57))&","},62)),2),","));
 TRANSPOSE(SPLIT(REPT(TEXTJOIN(",",1,REPT({ROW(INDIRECT("A"&65&":A"&90))&",";
        ROW(INDIRECT("A"&97&":A"&122))&",";ROW(INDIRECT("A"&48&":A"&57))&","},62)),2),","));
 TRANSPOSE(SPLIT(TEXTJOIN(",",1,REPT({ROW(INDIRECT("A"&65&":A"&89))&","},62)),","));
 TRANSPOSE(SPLIT(TEXTJOIN(",",1,REPT(90&",",11)),","))},{
 TRANSPOSE(SPLIT(TRANSPOSE(REPT(TEXTJOIN(",",1,{ROW(INDIRECT("A"&65&":A"&90));
                 ROW(INDIRECT("A"&97&":A"&122));ROW(INDIRECT("A"&48&":A"&57))})&",",150)),","));
 TRANSPOSE(SPLIT(TRANSPOSE(REPT(TEXTJOIN(",",1,{ROW(INDIRECT("A"&65&":A"&90));
                 ROW(INDIRECT("A"&97&":A"&122));ROW(INDIRECT("A"&48&":A"&57))})&",",150)),","));
 TRANSPOSE(SPLIT(TRANSPOSE(REPT(TEXTJOIN(",",1,{ROW(INDIRECT("A"&65&":A"&90));
                 ROW(INDIRECT("A"&97&":A"&122));ROW(INDIRECT("A"&48&":A"&57))})&",",150)),","));
 TRANSPOSE(SPLIT(TRANSPOSE(REPT(TEXTJOIN(",",1,{ROW(INDIRECT("A"&65&":A"&90));
                 ROW(INDIRECT("A"&97&":A"&122));ROW(INDIRECT("A"&48&":A"&57))})&",",150)),","));
 TRANSPOSE(SPLIT(TRANSPOSE(REPT(TEXTJOIN(",",1,{ROW(INDIRECT("A"&65&":A"&90));
                 ROW(INDIRECT("A"&97&":A"&122));ROW(INDIRECT("A"&48&":A"&57))})&",",45)),","));
 TRANSPOSE(SPLIT(TRANSPOSE(TEXTJOIN(",",1,ROW(INDIRECT("A"&65&":A"&75)))&","),","))}}))), , 
 40001)), " ", ""))

0

1
user0