La fonction REMPLACER() remplace des caractères dans un texte. REMPLACER() appartient aux fonctions de texte d'Excel.
La syntaxe REMPLACER
La fonction Excel REMPLACER() suit la syntaxe suivante :
=REMPLACER(ancien_caractère;no_départ;nb_caractères;nouveau_caractère)
où :
- ancien_caractère correspond au caractère à remplacer
- no_départ désigne la position du caractère à remplacer
- nb_caractères correspond au nombre de caractères à remplacer
- nouveau_caractère désigne le nouveau caractère
La fonction REMPLACER en exemple
La formule
A | B | C | D | E | |
---|---|---|---|---|---|
1 | N° atomique | Élément chimique | Symbole chimique | ||
2 | 1 | Hydrogène | H | =REMPLACER(B2;4;20;" - "&A2) | |
3 | 2 | Hélium | He | =REMPLACER(B3;4;20;" - "&A3) | |
4 | 3 | Lithium | Li | =REMPLACER(B4;4;20;" - "&A4) | |
5 | 4 | Béryllium | Be | =REMPLACER(B5;4;20;" - "&A5) | |
6 | 5 | Bore | B | =REMPLACER(B6;4;20;" - "&A6) | |
7 | 6 | Carbone | C | =REMPLACER(B7;4;20;" - "&A7) | |
8 | 7 | Azote | N | =REMPLACER(B8;4;20;" - "&A8) | |
9 | 8 | Oxygène | O | =REMPLACER(B9;4;20;" - "&A9) | |
10 | 9 | Fluor | F | =REMPLACER(B10;4;20;" - "&A10) |
Le résultat
A | B | C | D | E | |
---|---|---|---|---|---|
1 | N° atomique | Élément chimique | Symbole chimique | ||
2 | 1 | Hydrogène | H | Hyd - 1 | |
3 | 2 | Hélium | He | Hél - 2 | |
4 | 3 | Lithium | Li | Lit - 3 | |
5 | 4 | Béryllium | Be | Bér - 4 | |
6 | 5 | Bore | B | Bor - 5 | |
7 | 6 | Carbone | C | Car - 6 | |
8 | 7 | Azote | N | Azo - 7 | |
9 | 8 | Oxygène | O | Oxy - 8 | |
10 | 9 | Fluor | F | Flu - 9 |