Excel Superscript is similar to the subscript function. Learn how to format a character slightly above the baseline through useful examples.
What is Superscript in Excel?
We use superscript in Excel to transform a number or text value into smaller fonts above the selected numbers and text. In most cases, we use this feature to create ordinal numbers, like 1st,2nd,3rd. Another option is to create unit measurements and special symbols.
Table of contents:
- How to use superscript in Excel?
- The Font Group
- Superscript shortcut
- Quick Access Toolbar command
- Alt key codes
- Char Function
- Apply Superscript function to create ordinal numbers
How to Superscript in Excel?
Using Font Group
1. Select the text that you want to convert to superscript format. Then, use the F2 edit cell shortcut to enter into the cell edit mode. You can edit the cell using the Formula Bar too!
2. Open the ‘Format Cells’ dialog box using the Ctrl + 1 shortcut or locate the Home Tab and check the Font Group. If you don’t want to use shortcuts, click on the small arrow icon in the bottom-right corner.
3. The ‘Format Cells’ dialog box appears. Select the Font Tab. Under the Effects Group, find the superscript option and click the checkbox.
We love Excel shortcuts. Let us see the fastest way to apply superscript.
The superscript shortcut key is:
Ctrl + Shift + F then Alt + E
First, use the Ctrl + Shift + F shortcut to open the Font Tab in the Format Cells dialog box.
After that, apply the Alt + E shortcut to add a superscript formatting style to the selected characters.
Finally, click OK to close the dialog box. This method is a bit slow; in the next chapter, you will learn to perform the task faster using a few-line macro.
Add Superscript macro to the Quick Access Toolbar
The Quick Access Toolbar is the best place to store the frequently used commands in Excel. For example, to add a new macro to the QAT, press the Alt + F11 shortcut and add a new Module.
Finally, copy-paste the code like in the picture below:
When you execute this macro, Excel will ask the position of the character that you want to format.
Sub QuickSuperscript() Dim i As Integer, str As String i = InputBox("Enter the char position") str = i ActiveCell.Characters(i, 1).Font.Superscript = True MsgBox "Superscript formatting has been applied" End Sub
Save the Workbook using the .xlsm or .xslb format. Then, use the File tab and click Options to open the Excel Options dialog.
To list the available macros in this Workbook, select Macros from the ‘Choose commands from..’ drop-down list.
Click Add to place the new macro to QAT and click OK to close the dialog box.
From now, you can apply superscript with a single click. In our example, the new macro is the third on the list, so the Alt, 3 shortcut works.
If you want to save your time, download the macro-enabled Workbook here.
Alt key codes for superscript format
If you are working with Excel, you can use three built-in superscript formatted numbers – there are 1,2, and 3.
Here is the list of built-in numbers; you can reach the function by pressing the Alt + number shortcut.
Good to know that the result is not a number, so you can not use these numbers in a function or formula. In the example, we are using the ‘Calibri’ font. If you are using another font, the result may be different.
The Char function
In Excel, you can apply superscripts using the CHAR function. However, the output is (in this case, too) a string, so we don’t recommend you use these cells as a part of a formula; otherwise, you’ll get a formula error.
Use the following numbers as a parameter of the CHAR function:
Apply Superscript function to create ordinal numbers
We are talking about an ordinal number if it is a number that tells the position in a list. The method is the same if you want to use the superscript shortcut on more than one character. For example, you want to create a rank using the usual 1st, 2nd,3rd pattern.
- Select the characters that you want to format
- Press Ctrl + 1 shortcut to open the ‘Format Cells’ dialog box
- Use the Alt + E shortcut to apply the superscript format
- Press Enter to close the dialog box.
Here is a faster, VBA-based solution: You can apply a macro to superscript the second and third characters. The procedure is the same as above; paste the code into a new module. Let us see the code!
'Macro to convert text to rank without displaying input box Sub TextToRank() Dim i As Integer For i = 2 To 3 ActiveCell.Characters(i, 1).Font.Superscript = True Next i 'MessageBox (Optional) MsgBox "You have converted the text to rank!" End Sub
Before we take a deep dive into equations:
Bear the following restriction in mind: you will get the result (superscripted string) in a text box. A text box is an object, not a cell with a value, so you cannot use any formulas or calculations.
1. Go to the Insert Tab on the ribbon and select the Equation icon under the Symbols Group.
2. Use the ‘Script’ drop-down menu and select superscript.
3. Add numbers to fill out the boxes.
Keep in mind
- The Excel superscript formatting works with text.
- Don’t use the shortcut on numbers because Excel will convert the data to a string, and you’ll lose cell format
- For numbers, use the ‘^’ math operator, like =3^2 = 9
- Apply a shortcut for all repetitive tasks; it is worth using it!