---
title: "TRIM, PROPER and UPPER practice: 4 exercises with answers"
description: "Practice cleaning text in Excel: remove extra spaces with TRIM, fix names with PROPER and clean codes with UPPER, in a live spreadsheet."
canonical_url: "https://excelsavvy.com/practice/trim-proper-upper"
meta:
  "og:description": "Practice cleaning text in Excel: remove extra spaces with TRIM, fix names with PROPER and clean codes with UPPER, in a live spreadsheet."
  "og:image": "https://excelsavvy.com/_og/d/c_Page%2Ctitle_~VFJJTSwgUFJPUEVSIGFuZCBVUFBFUiBwcmFjdGljZTogNCBleGVyY2lzZXMgd2l0aCBhbnN3ZXJz%2Cdescription_~UHJhY3RpY2UgY2xlYW5pbmcgdGV4dCBpbiBFeGNlbDogcmVtb3ZlIGV4dHJhIHNwYWNlcyB3aXRoIFRSSU0sIGZpeCBuYW1lcyB3aXRoIFBST1BFUiBhbmQgY2xlYW4gY29kZXMgd2l0aCBVUFBFUiwgaW4gYSBsaXZlIHNwcmVhZHNoZWV0Lg%2Ceyebrow_Excel%2Bpractice%2Bexercises%2Csite_practiceexcel%2Cprops_eyJncmlkIjp7ImNvbHMiOlsiQSIsIkIiXSwicm93cyI6W3sibiI6MSwiY2VsbHMiOlsiTmFtZSBhcyBpbXBvcnRlZCIsIkNsZWFuIG5hbWUiXX0seyJuIjoyLCJjZWxscyI6WyIgIEFubmEgICBCZXJnICIsIiJdfV0sInRhcmdldCI6WzEsMV19fQ%2Cp_Ii9wcmFjdGljZS90cmltLXByb3Blci11cHBlciI%2Cs_IKda5E_We37C7_Ry.png"
  "og:image:height": "600"
  "og:image:type": image/png
  "og:image:width": "1200"
  "og:title": "TRIM, PROPER and UPPER practice: 4 exercises with answers"
  "twitter:image": "https://excelsavvy.com/_og/d/c_Page%2Ctitle_~VFJJTSwgUFJPUEVSIGFuZCBVUFBFUiBwcmFjdGljZTogNCBleGVyY2lzZXMgd2l0aCBhbnN3ZXJz%2Cdescription_~UHJhY3RpY2UgY2xlYW5pbmcgdGV4dCBpbiBFeGNlbDogcmVtb3ZlIGV4dHJhIHNwYWNlcyB3aXRoIFRSSU0sIGZpeCBuYW1lcyB3aXRoIFBST1BFUiBhbmQgY2xlYW4gY29kZXMgd2l0aCBVUFBFUiwgaW4gYSBsaXZlIHNwcmVhZHNoZWV0Lg%2Ceyebrow_Excel%2Bpractice%2Bexercises%2Csite_practiceexcel%2Cprops_eyJncmlkIjp7ImNvbHMiOlsiQSIsIkIiXSwicm93cyI6W3sibiI6MSwiY2VsbHMiOlsiTmFtZSBhcyBpbXBvcnRlZCIsIkNsZWFuIG5hbWUiXX0seyJuIjoyLCJjZWxscyI6WyIgIEFubmEgICBCZXJnICIsIiJdfV0sInRhcmdldCI6WzEsMV19fQ%2Cp_Ii9wcmFjdGljZS90cmltLXByb3Blci11cHBlciI%2Cs_IKda5E_We37C7_Ry.png"
---

> Index of every page on this site: [llms.txt](https://excelsavvy.com/llms.txt)

# **TRIM, PROPER and UPPER practice exercises**

Tidy up text that came from somewhere else: strip extra spaces, and fix names and codes typed in the wrong case.

[**Start the first exercise**](https://excelsavvy.com/practice/trim-proper-upper/trim-extra-spaces)

PROPER(TRIM(

## **How TRIM, PROPER and UPPER work**

TRIM, PROPER and UPPER each fix one thing in a text. TRIM removes extra spaces at the start and end and leaves a single space between words. UPPER makes every letter a capital, LOWER makes every letter small, and PROPER capitalizes the first letter of each word. Each takes one argument: the text, or the cell that holds it.

Names and codes pasted from other systems are rarely clean. If A2 holds " maria LOPEZ ", `**=PROPER(TRIM(A2))**` returns "Maria Lopez". The functions sit inside each other: TRIM runs first, then PROPER fixes the capitals. `**=UPPER(TRIM(A2))**` does the same for a code and returns it in capitals with no extra spaces.

These functions build a new text and leave the original alone. To replace the original, put the formula in a helper column, copy the result and paste it back as values. PROPER is not perfect either: "mcdonald" becomes "Mcdonald", so names like that need a manual fix. The exercises below cover removing extra spaces, fixing the case of names, cleaning a code with UPPER and TRIM, and fixing messy names with PROPER and TRIM.

1. [**1****Remove extra spaces with TRIM**In B2, use TRIM to remove the extra spaces from the name in A2.](https://excelsavvy.com/practice/trim-proper-upper/trim-extra-spaces)
2. [**2****Fix the case of names with PROPER****Premium**In B2, use PROPER to write the name in A2 with a capital first letter in each word.](https://excelsavvy.com/practice/trim-proper-upper/proper-capitalize-names)
3. [**3****Clean a code with UPPER and TRIM****Premium**In B2, clean up the code in A2 so it has no extra spaces and is all capitals. Put TRIM inside UPPER.](https://excelsavvy.com/practice/trim-proper-upper/upper-trim-clean-codes)
4. [**4****Fix messy names with PROPER and TRIM****Premium**The name in A2 has extra spaces and the wrong capitals. In B2, clean it up to "Maria Lopez". Put TRIM inside PROPER.](https://excelsavvy.com/practice/trim-proper-upper/proper-trim-clean-names)

## **Functions in this topic**

- [**PROPER**](https://excelsavvy.com/functions/proper)
- [**TRIM**](https://excelsavvy.com/functions/trim)

## **Read the guide**

- [**Free Excel course online: learn Excel from your first formula to job-ready**](https://excelsavvy.com/learn/how-to-learn-excel)
- [**VLOOKUP vs XLOOKUP vs INDEX MATCH: which lookup to use**](https://excelsavvy.com/learn/vlookup-vs-xlookup-vs-index-match)
- [**How to clean data in Excel with formulas**](https://excelsavvy.com/learn/clean-data-in-excel)
- [**Line breaks in Excel: a new line in a cell, with a formula and gone again**](https://excelsavvy.com/learn/line-break-in-excel)
- [**Excel data cleaning practice: a messy file with tasks and answers**](https://excelsavvy.com/learn/excel-data-cleaning-practice)

## **Questions**

<details>

<summary>

### Why doesn't TRIM remove all the spaces in my cell?

</summary>

TRIM only removes regular spaces. Text copied from web pages often contains non-breaking spaces, character 160, which TRIM leaves alone. Swap them first: =TRIM(SUBSTITUTE(A2,CHAR(160)," ")). TRIM also keeps one space between words. To remove every space, use =SUBSTITUTE(A2," ","") instead.

</details>

<details>

<summary>

### How do I change text to uppercase or lowercase in Excel?

</summary>

Use UPPER for capitals, LOWER for small letters and PROPER for a capital at the start of each word. For example, =LOWER(A2) turns "ABC-12" into "abc-12". The result is a new text, so write the formula in a helper column next to the original and copy the values back if you need to replace it.

</details>

<details>

<summary>

### How do I capitalize only the first letter of a sentence in Excel?

</summary>

PROPER capitalizes every word, so it doesn't work for a sentence. Use =UPPER(LEFT(A2,1))&amp;LOWER(MID(A2,2,LEN(A2))) instead. It makes the first letter a capital and the rest lowercase. Keep in mind that this also lowercases names and abbreviations in the middle of the sentence.

</details>

```json
{"@context":"https://schema.org","@graph":[{"@id":"https://excelsavvy.com/#identity","@type":"Organization","name":"ExcelSavvy","url":"https://excelsavvy.com/","logo":{"@id":"https://excelsavvy.com/#logo"}},{"@id":"https://excelsavvy.com/#website","@type":"WebSite","inLanguage":"en-US","name":"ExcelSavvy","url":"https://excelsavvy.com/","alternateName":["Excel Savvy","ExcelSavvy.com","PracticeExcel","Practice Excel Online"],"publisher":{"@id":"https://excelsavvy.com/#identity"},"workTranslation":[{"@id":"https://excelopgaver.dk/#website"},{"@id":"https://excelpraxis.de/#website"}]},{"@id":"https://excelsavvy.com/practice/trim-proper-upper#webpage","description":"Practice cleaning text in Excel: remove extra spaces with TRIM, fix names with PROPER and clean codes with UPPER, in a live spreadsheet.","name":"TRIM, PROPER and UPPER practice: 4 exercises with answers","url":"https://excelsavvy.com/practice/trim-proper-upper","@type":["WebPage","CollectionPage","FAQPage"],"breadcrumb":{"@id":"https://excelsavvy.com/practice/trim-proper-upper#breadcrumb"},"isPartOf":{"@id":"https://excelsavvy.com/#website"},"mainEntity":[{"@id":"https://excelsavvy.com/practice/trim-proper-upper#/schema/question/1"},{"@id":"https://excelsavvy.com/practice/trim-proper-upper#/schema/question/2"},{"@id":"https://excelsavvy.com/practice/trim-proper-upper#/schema/question/3"}],"potentialAction":[{"@type":"ReadAction","target":["https://excelsavvy.com/practice/trim-proper-upper"]}],"primaryImageOfPage":{"@id":"https://excelsavvy.com/#logo"}},{"@id":"https://excelsavvy.com/practice/trim-proper-upper#breadcrumb","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","name":"Home","item":"https://excelsavvy.com","position":1},{"@type":"ListItem","name":"Excel practice exercises","item":"https://excelsavvy.com/practice","position":2},{"@type":"ListItem","name":"TRIM, PROPER and UPPER practice: 4 exercises with answers","position":3}]},{"@id":"https://excelsavvy.com/practice/trim-proper-upper#/schema/question/1","@type":"Question","inLanguage":"en-US","name":"Why doesn't TRIM remove all the spaces in my cell?","acceptedAnswer":{"@type":"Answer","text":"TRIM only removes regular spaces. Text copied from web pages often contains non-breaking spaces, character 160, which TRIM leaves alone. Swap them first: =TRIM(SUBSTITUTE(A2,CHAR(160),\" \")). TRIM also keeps one space between words. To remove every space, use =SUBSTITUTE(A2,\" \",\"\") instead."}},{"@id":"https://excelsavvy.com/practice/trim-proper-upper#/schema/question/2","@type":"Question","inLanguage":"en-US","name":"How do I change text to uppercase or lowercase in Excel?","acceptedAnswer":{"@type":"Answer","text":"Use UPPER for capitals, LOWER for small letters and PROPER for a capital at the start of each word. For example, =LOWER(A2) turns \"ABC-12\" into \"abc-12\". The result is a new text, so write the formula in a helper column next to the original and copy the values back if you need to replace it."}},{"@id":"https://excelsavvy.com/practice/trim-proper-upper#/schema/question/3","@type":"Question","inLanguage":"en-US","name":"How do I capitalize only the first letter of a sentence in Excel?","acceptedAnswer":{"@type":"Answer","text":"PROPER capitalizes every word, so it doesn't work for a sentence. Use =UPPER(LEFT(A2,1))&LOWER(MID(A2,2,LEN(A2))) instead. It makes the first letter a capital and the rest lowercase. Keep in mind that this also lowercases names and abbreviations in the middle of the sentence."}},{"@id":"https://excelsavvy.com/#logo","@type":"ImageObject","caption":"ExcelSavvy","contentUrl":"https://excelsavvy.com/brand/practiceexcel/icon-512.png?v=3","inLanguage":"en-US","url":"https://excelsavvy.com/brand/practiceexcel/icon-512.png?v=3"}]}
```

## Sitemap

See the full [sitemap](https://excelsavvy.com/sitemap.md) for all pages.
