Skip to content

Instantly share code, notes, and snippets.

@coccoinomane
Last active May 6, 2025 10:08
Show Gist options
  • Save coccoinomane/501e9520168033eee518 to your computer and use it in GitHub Desktop.
Save coccoinomane/501e9520168033eee518 to your computer and use it in GitHub Desktop.
Copy this formula into an Excel cell to generate a random 9-character password

Copy this formula into an Excel cell to generate a random 9-character password. Then Copy & Paste Special (as value) in place in order to avoid the cell being continuosly re-evaluated.

English version

=CHAR(RANDBETWEEN(65;90))&CHAR(RANDBETWEEN(97;122))&CHAR(RANDBETWEEN(97;122))&CHAR(RANDBETWEEN(65;90))&RANDBETWEEN(1000;9999)&CHAR(RANDBETWEEN(42;43))

English version (with commas)

If the previous formula does not work, try with commas instead of semicolons:

=CHAR(RANDBETWEEN(65,90))&CHAR(RANDBETWEEN(97,122))&CHAR(RANDBETWEEN(97,122))&CHAR(RANDBETWEEN(65,90))&RANDBETWEEN(1000,9999)&CHAR(RANDBETWEEN(42,43))

Spanish version (gracias @soportesistemas4)

=CARACTER(ALEATORIO.ENTRE(65,90))&CARACTER(ALEATORIO.ENTRE(97,122))&CARACTER(ALEATORIO.ENTRE(97,122))&CARACTER(ALEATORIO.ENTRE(65,90))&ALEATORIO.ENTRE(1000,9999)&CARACTER(ALEATORIO.ENTRE(42,43))

German version (danke @Cyberkommander!)

=ZEICHEN(ZUFALLSBEREICH(65;90))&ZEICHEN(ZUFALLSBEREICH(97;122))&ZEICHEN(ZUFALLSBEREICH(97;122))&ZEICHEN(ZUFALLSBEREICH(65;90))&ZUFALLSBEREICH(1000;9999)&ZEICHEN(ZUFALLSBEREICH(42;43))

Portoguese version (muito obrigado @THISisREALISTIC!)

=CAR脕T(ALEAT脫RIOENTRE(65;90))&CAR脕T(ALEAT脫RIOENTRE(97;122))&CAR脕T(ALEAT脫RIOENTRE(97;122))&CAR脕T(ALEAT脫RIOENTRE(65;90))&ALEAT脫RIOENTRE(1000;9999)&CAR脕T(ALEAT脫RIOENTRE(42;43))

Brazilian portoguese version (muito obrigado @eulergui!)

=CARACT(ALEAT脫RIOENTRE(65;90))&CARACT(ALEAT脫RIOENTRE(97;122))&CARACT(ALEAT脫RIOENTRE(97;122))&CARACT(ALEAT脫RIOENTRE(65;90))&ALEAT脫RIOENTRE(1000;9999)&CARACT(ALEAT脫RIOENTRE(42;43))

French version (merci beaucoup @foutrak!)

=CAR(ALEA.ENTRE.BORNES(65;90))&CAR(ALEA.ENTRE.BORNES(97;122))&CAR(ALEA.ENTRE.BORNES(97;122))&CAR(ALEA.ENTRE.BORNES(65;90))&ALEA.ENTRE.BORNES(1000;9999)&CAR(ALEA.ENTRE.BORNES(42;43))

Italian version (dajeeee @iomariani!)

=CARATT.UNI(CASUALE.TRA(65;90))&CARATT.UNI(CASUALE.TRA(97;122))&CARATT.UNI(CASUALE.TRA(97;122))&CARATT.UNI(CASUALE.TRA(65;90))&CASUALE.TRA(1000;9999)&CARATT.UNI(CASUALE.TRA(42;43))

Polish version (na zdrowie @weedget!)

=ZNAK(LOS.ZAKR(65;90))&ZNAK(LOS.ZAKR(97;122))&ZNAK(LOS.ZAKR(97;122))&ZNAK(LOS.ZAKR(65;90))&LOS.ZAKR(1000;9999)&ZNAK(LOS.ZAKR(42;43))

Russian version (小锌邪褋懈斜芯 @1shindes!)

=小袠袦袙袨袥(小袥校效袦袝袞袛校(65;90))&小袠袦袙袨袥(小袥校效袦袝袞袛校(97;122))&小袠袦袙袨袥(小袥校效袦袝袞袛校(97;122))&小袠袦袙袨袥(小袥校效袦袝袞袛校(65;90))&小袥校效袦袝袞袛校(1000;9999)&小袠袦袙袨袥(小袥校效袦袝袞袛校(42;43))

Dutch version (Bedankt @KarenBBla!)

=TEKEN(ASELECTTUSSEN(65;90))&TEKEN(ASELECTTUSSEN(97;122))&TEKEN(ASELECTTUSSEN(97;122))&TEKEN(ASELECTTUSSEN(65;90))&ASELECTTUSSEN(1000;9999)&TEKEN(ASELECTTUSSEN(42;43))

Hungarian (magyar) version (K枚sz枚n枚m @Nortonor!)

=TEKEN(ASELECTTUSSEN(65;90))&TEKEN(ASELECTTUSSEN(97;122))&TEKEN(ASELECTTUSSEN(97;122))&TEKEN(ASELECTTUSSEN(65;90))&ASELECTTUSSEN(1000;9999)&TEKEN(ASELECTTUSSEN(42;43))
@afanucchi
Copy link

afanucchi commented Mar 1, 2018

Please note, the parameter separator is meant to be a comma , and not a semi-colon ; between each of those number pairs! (Might be Excel 2013+)

@gonik
Copy link

gonik commented Mar 3, 2018

@afanucchi in most EU countries, the semicolon is used for the separator, instead for the comma

@Cyberkommander
Copy link

German Excel:
=ZEICHEN(ZUFALLSBEREICH(65;90))&ZEICHEN(ZUFALLSBEREICH(97;122))&ZEICHEN(ZUFALLSBEREICH(97;122))&ZEICHEN(ZUFALLSBEREICH(65;90))&ZUFALLSBEREICH(1000;9999)&ZEICHEN(ZUFALLSBEREICH(42;43))

@coccoinomane
Copy link
Author

Thanks guys, I have update the gist!

@THISisREALISTIC
Copy link

In Portuguese EU:

=CAR脕T(ALEAT脫RIOENTRE(65;90))&CAR脕T(ALEAT脫RIOENTRE(97;122))&CAR脕T(ALEAT脫RIOENTRE(97;122))&CAR脕T(ALEAT脫RIOENTRE(65;90))&ALEAT脫RIOENTRE(1000;9999)&CAR脕T(ALEAT脫RIOENTRE(42;43))

@coccoinomane
Copy link
Author

Thanks @THISisREALISTIC, I added your contribution to the gist 馃憤

@foutrak
Copy link

foutrak commented Apr 29, 2021

Also in French Excel :
=CAR(ALEA.ENTRE.BORNES(65;90))&CAR(ALEA.ENTRE.BORNES(97;122))&CAR(ALEA.ENTRE.BORNES(97;122))&CAR(ALEA.ENTRE.BORNES(65;90))&ALEA.ENTRE.BORNES(1000;9999)&CAR(ALEA.ENTRE.BORNES(42;43))

@coccoinomane
Copy link
Author

Merci @foutrak for the French formula! It is now in the gist :-)

@weedget
Copy link

weedget commented Aug 9, 2021

if you want to add Polish version here it is:
=ZNAK(LOS.ZAKR(65;90))&ZNAK(LOS.ZAKR(97;122))&ZNAK(LOS.ZAKR(97;122))&ZNAK(LOS.ZAKR(65;90))&LOS.ZAKR(1000;9999)&ZNAK(LOS.ZAKR(42;43))

@coccoinomane
Copy link
Author

Thanks @weedget, I included the Polish formula in the gist 馃憤
We are getting better than the UN!!! 馃槀

@soportesistemas4
Copy link

soportesistemas4 commented Feb 26, 2022

Spanish
CARACTER(ALEATORIO.ENTRE(65,90))&CARACTER(ALEATORIO.ENTRE(65,90))&ALEATORIO.ENTRE(100,999)&CARACTER(ALEATORIO.ENTRE(65,90))

@robertPlace
Copy link

You're a damn hero!

@eulergui
Copy link

In Brazilian Portuguese:
=CARACT(ALEAT脫RIOENTRE(65;90))&CARACT(ALEAT脫RIOENTRE(97;122))&CARACT(ALEAT脫RIOENTRE(97;122))&CARACT(ALEAT脫RIOENTRE(65;90))&ALEAT脫RIOENTRE(1000;9999)&CARACT(ALEAT脫RIOENTRE(42;43))

@coccoinomane
Copy link
Author

coccoinomane commented Nov 15, 2022

Thank you @soportesistemas4 and @eulergui: I added your formulas to the gist 馃挭馃寧馃晩

@iomariani
Copy link

Italian 馃嚠馃嚬
=CARATT.UNI(CASUALE.TRA(65;90))&CARATT.UNI(CASUALE.TRA(97;122))&CARATT.UNI(CASUALE.TRA(97;122))&CARATT.UNI(CASUALE.TRA(65;90))&CASUALE.TRA(1000;9999)&CARATT.UNI(CASUALE.TRA(42;43))

@robertPlace
Copy link

Just want to comment again that I still use this daily for about a year now.

@coccoinomane
Copy link
Author

Just want to comment again that I still use this daily for about a year now.

It makes me happy 鉂わ笍

@foutrak
Copy link

foutrak commented Dec 9, 2022

Still using it and following the thread a year and half after 馃憤 thanks again

@coccoinomane
Copy link
Author

Still using it and following the thread a year and half after 馃憤 thanks again

Amazing! Now let鈥檚 all hope they don鈥檛 crack our passwords 馃槀

@1shindes
Copy link

1shindes commented May 1, 2024

Here's Russian version:
=小袠袦袙袨袥(小袥校效袦袝袞袛校(65;90))&小袠袦袙袨袥(小袥校效袦袝袞袛校(97;122))&小袠袦袙袨袥(小袥校效袦袝袞袛校(97;122))&小袠袦袙袨袥(小袥校效袦袝袞袛校(65;90))&小袥校效袦袝袞袛校(1000;9999)&小袠袦袙袨袥(小袥校效袦袝袞袛校(42;43))

@KarenBBla
Copy link

Dutch version:
=TEKEN(ASELECTTUSSEN(65;90))&TEKEN(ASELECTTUSSEN(97;122))&TEKEN(ASELECTTUSSEN(97;122))&TEKEN(ASELECTTUSSEN(65;90))&ASELECTTUSSEN(1000;9999)&TEKEN(ASELECTTUSSEN(42;43))

@coccoinomane
Copy link
Author

Thank you @1shindes and聽@KarenBBla, I added your versions to the gist 鉂わ笍

@Nortonor
Copy link

Hungarian (magyar) version:
=KARAKTER(V脡LETLEN.K脰Z脰TT(65;90))&KARAKTER(V脡LETLEN.K脰Z脰TT(97;122))&KARAKTER(V脡LETLEN.K脰Z脰TT(97;122))&KARAKTER(V脡LETLEN.K脰Z脰TT(65;90))&V脡LETLEN.K脰Z脰TT(1000;9999)&KARAKTER(V脡LETLEN.K脰Z脰TT(42;43))

@coccoinomane
Copy link
Author

K枚sz枚n枚m @Nortonor, added the magyar version to the gist 馃挭

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment