Informazioni sull’esercizio
Un set di dati di 120 righe su un foglio, una cella di risposta, circa 6 minuti. Correzione nel tuo browser: il valore e la formula che lo produce, con indicazioni su cosa sistemare.
Come risolverlo
- 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.
Altri metodi validi
- =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
Errori comuni
Using PROPER without TRIM: =PROPER(B2) returns "··Jean-Luc··Jackson·" (· marks a space) — capitalised, but with the padding and the doubled space still there.
Come valutiamo
È accettata qualsiasi formula che produce il risultato giusto, a meno che l’attività non indichi una funzione: in quel caso un’altra funzione vale metà dei punti. Confrontiamo i valori con una piccola tolleranza e ignoriamo maiuscole, minuscole e spazi nel testo. Un numero corretto digitato a mano invece di una formula vale metà dei punti. Le attività su più celle valgono il punteggio pieno con il 100% delle celle giuste, metà dei punti dal 50%. Dove serve, cambiamo anche una cella di input su una copia del tuo foglio e controlliamo che la formula si aggiorni.
Risposte calcolate con le regole di Excel 365 e verificate nel nostro correttore in data 16 novembre 2026. Autore: GridBelt team.