Aller au contenu
GridBelt
  • Test Excel
  • Exercices
  • Programmes
  • Tarifs
Se connecter
Commencer le test gratuit
  • Test Excel
  • Exercices
  • Programmes
  • Tarifs
Se connecterCréer un compte
Commencer le test gratuit
GridBelt

Entraînez-vous sur Excel dans votre navigateur.

Test Excel

  • Niveau 1 : Débutant
  • Niveau 2 : Intermédiaire
  • Niveau 3 : Expert
  • Test Excel en 7 jours
  • Classement
  • Test Excel en entretien d’embauche
  • Évaluation Excel d’Indeed

Exercices

  • Tous les exercices
  • Programmes
  • Pour débutants

Guides

  • Formules Excel
  • Raccourcis Excel

Entreprise

  • À propos
  • Tarifs
  • Comment nous corrigeons

© GridBelt. Tous droits réservés.

  • Politique de confidentialité
  • Conditions d’utilisation
  • Politique de remboursement

Excel est une marque commerciale de Microsoft Corporation. Indeed, TestGorilla, SHL et les autres marques sont la propriété de leurs détenteurs respectifs. GridBelt est un site d’entraînement indépendant ; il n’est affilié ni à Microsoft, ni à TestGorilla, ni à SHL, ni à Indeed, et n’est ni cautionné ni sponsorisé par ces sociétés.

  1. Exercices
  2. /
  3. Text functions

TRIM and PROPER practice: clean 120 customer names typed by hand

  • Intermédiaire
  • ~6 min
  • Text functions

Énoncé en anglais

120 customers typed their own names into the web-shop checkout, and the export shows it: 69 names carry spaces before or after, 51 have two or three spaces between first and last name, and 101 are all lower case, ALL CAPS or randomly capitalised. B2 alone reads "··JEAN-LUC··JACKSON·" (· marks a space). Produce a clean "First Last" version of every name in C2:C121 — single spaces, capital first letters — ready for the mailing labels.

Ce que vous devez faire

  1. 1Click C2 and type =TRIM(B2): TRIM removes the spaces before and after the text and squeezes every run of spaces inside it to a single space. C2 now shows "JEAN-LUC JACKSON".
  2. 2Wrap it in PROPER: =PROPER(TRIM(B2)). PROPER capitalises the first letter of each word and lower-cases the rest — C2 reads Jean-Luc Jackson.
  3. 3Fill C2 down to C121 (double-click the fill handle, or select C2:C121 and press Ctrl+D on Windows / ⌘D on Mac).
  4. 4Check a few rows with punctuation, e.g. Hugo O'Neil (row 66) and Jean-Luc Jackson (row 2): the letter after an apostrophe or a hyphen is capitalised too — that is how PROPER works.

Cellules de réponse

Correction

Saisissez votre formule dans la grille, appuyez sur Enter, puis cliquez sur Vérifier. Nous corrigeons la valeur de chaque cellule de réponse et la formule qui la produit.

Tâches

  1. Non vérifiéIn C2, clean the name in B2 with TRIM and PROPER — remove the extra spaces and capitalise each word — then fill down to C121.

Ordinateur recommandé pour les tâches dans la feuille de calcul. La feuille défile à l’intérieur de ce cadre.

StartInsertFormulasDataView
A1fxPréparation de votre classeur…
A
B
C
D
E
F
G
H
I
J
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
Sheet1

Saisissez votre formule dans la feuille, puis vérifiez.

À propos de cet exercice

Un jeu de données de 120 lignes sur une feuille, une cellule de réponse, environ 6 minutes. Corrigé dans votre navigateur : la valeur et la formule qui la produit, avec des indications sur la correction à apporter.

Comment le résoudre

  • C2=PROPER(TRIM(B2))

TRIM removes all spaces from a text except single spaces between words: leading and trailing spaces disappear and "JEAN-LUC···JACKSON" becomes "JEAN-LUC·JACKSON". PROPER then capitalises the first letter of every word and makes all other letters lower case, so lower-case, ALL-CAPS and randomly cased entries all end up as "First Last". Nesting them — PROPER(TRIM(B2)) — applies both fixes in one cell, and the check is strict about case: "jean-luc jackson" would not count.

Pitfall 1: PROPER alone leaves the doubled inner spaces, and the grader compares the text exactly — 51 of the 120 rows would fail; TRIM alone leaves the wrong case. Both are needed. Pitfall 2: PROPER capitalises after every non-letter, so "o'neil" becomes O'Neil (fine) but "mcdonald" becomes Mcdonald and "iPhone" becomes Iphone — review names with internal capitals by hand or fix them with SUBSTITUTE. Pitfall 3: TRIM only removes the normal space, CHAR(32). Web forms and copied web pages often contain the non-breaking space CHAR(160), which TRIM ignores in Excel; use TRIM(SUBSTITUTE(B2,CHAR(160)," ")) for those, and CLEAN for line breaks and other non-printing characters. Flash Fill (Ctrl+E) or Text to Columns can fix one export quickly but leave static values; the formula keeps cleaning new rows. To compare cleaned names with another list safely, also apply LOWER or use EXACT only after both sides are cleaned the same way.

Autres méthodes valables

  • =TRIM(PROPER(B2)) — same result, functions nested the other way round
  • =PROPER(TRIM(SUBSTITUTE(B2,CHAR(160)," "))) — also handles non-breaking spaces from web forms
  • =PROPER(TRIM(CLEAN(B2))) — additionally strips line breaks and other non-printing characters

Erreurs fréquentes

Using PROPER without TRIM: =PROPER(B2) returns "··Jean-Luc··Jackson·" (· marks a space) — capitalised, but with the padding and the doubled space still there.

Comment nous corrigeons

Toute formule qui produit le bon résultat est acceptée, sauf si la tâche nomme une fonction : une autre fonction rapporte alors la moitié des points. Nous comparons les valeurs avec une petite tolérance et ignorons la casse et les espaces dans le texte. Un nombre correct saisi à la main au lieu d’une formule rapporte la moitié des points. Les tâches sur plusieurs cellules rapportent tous les points avec 100 % de cellules justes, la moitié à partir de 50 %. Lorsque c’est pertinent, nous modifions aussi une cellule d’entrée sur une copie de votre feuille et vérifions que votre formule suit.

Réponses calculées selon les règles d’Excel 365 et vérifiées dans notre correcteur le 16 novembre 2026. Auteur : GridBelt team.

Dans ces programmes

  • Excel test in 7 days, Plan de niveau 2Jour 4
  • Excel test in 7 days, Plan de niveau 3Jour 3
  • Excel for Data AnalystsJour 5

Exercices associés

  • Full name with CONCAT or &Débutant, ~4 min
  • Split email into user and domain (FIND/LEFT/RIGHT or TEXTBEFORE/TEXTAFTER)Intermédiaire, ~7 min
  • Turn text dates into real dates and group by monthExpert, ~12 min

Référence de la fonction

Documentation officielle

Exercice suivant

Combine tags per product with TEXTJOIN