How to use the UPPER function
What is the UPPER function?
The UPPER function converts letters in a value to upper case letters.
Table of Contents
1. Introduction
What are upper case letters?
Upper case letters refer to the large form of the letters of the alphabet, they are the opposite of lower case letters.
The upper case letters are:
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Does Excel functions differentiate between upper and lower letters?
Most often not, however, there are exceptions. The equal sign does not differentiate between upper and lower case letter. Other functions are COUNTIF, COUNTIFS, SEARCH.
- The equal sign is a logical operator which lets you compare values. For example, ="A"="a" returns TRUE because it handles upper and lower case letters as the same.
- The COUNTIF function in Excel is not case-sensitive by default. This means that it treats upper and lower case letters as the same.
Here's an example: Suppose you have a range of cells A1:A5 with the following values: Apple, apple, APPLE, Orange, orange
If you use the COUNTIF function to count the number of cells that contain the text "apple", like this:
=COUNTIF(A1:A5, "apple")
The function will return 3, because it counts all the cells that contain "apple", "Apple", or "APPLE" as the same. This is because the COUNTIF function is not case-sensitive, so it treats upper and lower case letters as equivalent. - SEARCH: This function is similar to FIND, but it is not case-sensitive.
Example: =SEARCH("hello", "Hello World") returns 1, because the string "hello" is found in the text "Hello World", regardless of case.
The FIND and EXACT functions among others do distinguish between upper and lower letters .
- EXACT: This function checks if two text strings are identical, including case. If the strings are not identical, it returns FALSE.
Example: =EXACT("Hello", "hello") returns FALSE, because the case is different. - FIND: This function finds the position of a text string within another text string, and is case-sensitive.
Example: =FIND("hello", "Hello World") returns 0, because the string "hello" is not found in the text "Hello World" (the case is different).
2. Syntax
UPPER(text)
text | Value to convert. Required. |
3. Example
The image above shows three values in cells B3:B5, they are: "Hello", 123, and "Good bye". Note that cell B4 contains digits and not letters. The function in cells C3:C5 converts all letters to upper case letters.
Formula in cell C3:
The function in cells C3:C5 return "HELLO", 123, and "GOOD BYE". Cell C4 shows the exact same value as in cell B4 meaning that the UPPER function doesn't change digits and other characters, however, letters are affected.
3. Function not working
- Check your spelling.
- Check the number of arguments you use, the UPPER function accepts only one argument.
4. How to change lower letter to upper letter for the position of a given character
The image above demonstrates a formula that replaces the third letter in any string with an upper case letter. The value in cell B3 is "oranges".
Formula in cell C3:
The formula in cell C3 returns "orAnges", note that the third letter is now an upper case letter. Here is a short breakdown of the formula:
- MID(B3, 3, 1): Extract the third letter from cell B3.
- UPPER(MID(B3, 3, 1)): Convert the letter to an upper case letter.
- REPLACE(B3, 3, 1, UPPER(MID(B3, 3, 1))) : Substitute the third letter in cell B3 with the upper case letter we created in the last step.
4.1 Explaining formula
Step 1 - Extract letter based on position
The MID function returns a substring from a string based on the starting position and the number of characters you want to extract.
MID(text, start_num, num_chars)
MID(B3, 3, 1)
becomes
MID("oranges", 3, 1)
and returns "a".
Step 2 - Convert to upper letter
The UPPER function converts a string to capital letters.
UPPER(MID(B3, 3, 1))
becomes
UPPER("a")
and returns "A".
Step 3 - Replace character based on position to an upper letter
The REPLACE function substitutes a string based on character position and length.
REPLACE(old_text, start_num, num_chars, new_text)
REPLACE(B3, 3, 1, UPPER(MID(B3, 3, 1)))
becomes
REPLACE(B3, 3, 1, "A")
becomes
REPLACE("oranges", 3, 1, "A")
and returns "orAnges".
5. How to change a given lower letter to an upper letter
The formula in cell C3 demonstrated in the image above converts the second lower case "p" from the right with an upper case "P".
Formula in cell C3:
The REPLACE function, that was used in section 4, replaces a specified number of characters in a text string with another set of characters. It requires you to specify the position of the characters to be replaced, as well as the number of characters to replace. The SUBSTITUTE function, on the other hand, replaces all occurrences of a specified text string with another text string. It does not require you to specify the position of the text to be replaced. However, the last argument allows you to specify which instance.
SUBSTITUTE(text, old_text, new_text, [instance_num])
The [instance_num] lets you specify which instance to substitute. The formula in cell C3 specifies 2 in the last argument.
5.1 Explaining formula
The SUBSTITUTE function substitutes a string with another string.
SUBSTITUTE(text, old_text, new_text, [instance_num])
SUBSTITUTE(B3, "p", "P", 2)
The first argument is a cell reference to cell B3, the second argument is the string to be replaced.
The third argument is what will be there after the substitution and the fourth argument is a number representing the instance.
6. How to change all lower letters to upper letters for a given character
The picture above shows a formula in cell C3 that converts all lower case "p" to an upper case "P" in cell B3.
Formula in cell C3:
The SUBSTITUTE function substitutes a string with another string.
SUBSTITUTE(text, old_text, new_text, [instance_num])
If the instance_num argument is omitted all instances are replaced.
Useful links
UPPER function - Microsoft Excel
Change the case of text
'UPPER' function examples
Table of Contents Count cells containing text from list Count entries based on date and time Count cells with text […]
This formula returns multiple values even if they are arranged differently or have minor misspellings compared to the lookup value.
What's on this page Reverse text Insert random characters Convert letters to numbers How to shuffle characters in the alphabet […]
Functions in 'Text' category
The UPPER function function is one of 29 functions in the 'Text' category.
How to comment
How to add a formula to your comment
<code>Insert your formula here.</code>
Convert less than and larger than signs
Use html character entities instead of less than and larger than signs.
< becomes < and > becomes >
How to add VBA code to your comment
[vb 1="vbnet" language=","]
Put your VBA code here.
[/vb]
How to add a picture to your comment:
Upload picture to postimage.org or imgur
Paste image link to your comment.
Contact Oscar
You can contact me through this contact form