In this article, we present 2 methods to auto-format fractions such that they shrink to smaller characters in the cells in which they appear, to look the same way as fractions in MS Word.
How to Display Fractions in Excel?
Before we apply special formatting to change the size, let’s display a fraction in Excel using typical number formatting.
Steps:
- Select the blank cells (in this example, B2) where the fractions will be entered (in this example, we want to type ¾).
- Go to the Home tab >> Number >> Dialog Launcher button. Or, just press CTRL+1.
A Format Cells window will pop up.
- In the Number section, select Fraction, then choose Up to one digit (1/4).
Cell B2 is formatted such that it can hold a fraction of one digit numerator and one digit denominator.
- Type your fraction here (3/4).
Notes:
Enter double or triple digit fractions by choosing Up to two digits or Up to three digits respectively. So, to enter a fraction like 3/14, choose Up to two digits. Likewise, to display a fraction like 3/123, choose Up to three digits.
How to Make Fractions Smaller in Excel: 2 Methods
If we write a fraction in smaller characters, it looks like a real mathematical expression. There isn’t a way to shrink fractions directly in Excel, but the following 2 methods are effective workarounds.
You will need to use a keyboard with a number pad to make use of these methods.
Method 1 – Using ALT Codes for Fractions
There are certain ALT codes to shrink the display of certain fractions in Excel. Here’s a list of all the ALT codes available for this purpose:
Let’s use one of them.
Steps:
- Select the cells (In this example, cell B2) that will contain the fractions in smaller characters.
- Press ALT+0188 or ALT+172 on the number pad of your keyboard.
This ALT code is only for displaying ¼ in smaller characters. The ALT codes for other individual fractions are provided above.
The fraction is displayed in smaller characters.
Method 2 – Using a VBA Code to Make Specified Fractions Smaller
We can also use VBA code to display some specified fractions in smaller characters.
Steps:
- Go to the Developer tab >> click on Visual Basic >> Insert >> Module.
A module window will appear.
- Copy the following VBA code and paste it into this module window:
Sub MakeFractionsSmallerInExcel()
Dim i As Integer, numer As String, denom As String
Dim orig As String, uFrac As String
For i = 1 To 63
If i = 0 Then
orig = i & "/64"
numer = ChrW(&H2070)
denom = ChrW(&H2082)
ElseIf i Mod 32 = 0 Then
orig = i / 32 & "/2"
numer = udfNumerator(i / 32)
denom = ChrW(&H2082)
ElseIf i Mod 16 = 0 Then
orig = i / 16 & "/4"
numer = udfNumerator(i / 16)
denom = ChrW(&H2084)
ElseIf i Mod 8 = 0 Then
orig = i / 8 & "/8"
numer = udfNumerator(i / 8)
denom = ChrW(&H2088)
ElseIf i Mod 4 = 0 Then
orig = i / 4 & "/16"
numer = udfNumerator(i / 4)
denom = ChrW(&H2081) & ChrW(&H2086)
ElseIf i Mod 2 = 0 Then
orig = i / 2 & "/32"
numer = udfNumerator(i / 2)
denom = ChrW(&H2083) & ChrW(&H2082)
Else
orig = i & "/64"
numer = udfNumerator(i)
denom = ChrW(&H2086) & ChrW(&H2084)
End If
Application.AutoCorrect.AddReplacement orig, numer & ChrW(&H2044) & denom
'Cells(Rows.Count, 1).End(xlUp).Offset(1, 0) = Chr(32) & orig
'Cells(Rows.Count, 1).End(xlUp).Offset(0, 1) = numer & ChrW(&H2044) & denom
Next i
End Sub
Function udfNumerator(n As Integer) As String
Dim it As Integer, it1 As Integer, str As String, str1 As String
If n > 9 Then
it = Int(n / 10)
Select Case it
Case 1
str = Chr(185)
Case 2, 3
str = Chr(176 + it)
Case 0, 4, 5, 6, 7, 8, 9
str = ChrW(&H2070 + it)
End Select
End If
it1 = n Mod 10
Select Case it1
Case 1
str1 = Chr(185)
Case 2, 3
str1 = Chr(176 + it1)
Case 0, 4, 5, 6, 7, 8, 9
str1 = ChrW(&H2070 + it1)
End Select
udfNumerator = str & str1
End Function
- Save the code by clicking the Save button.
- Run the code by pressing F5 or clicking the green Play button.
Here is the list of specified fractions which can be typed in smaller characters after running the VBA code.
Download Practice Workbook
Related Articles
- Convert Fraction to Decimal in Excel
- [Solved!] Fraction Changing to Date in Excel
- How to Add a Stacked Fraction in Excel
- How to Format Fraction to Percentage in Excel
<< Go Back to Fraction in Excel | Number Format | Learn Excel
Get FREE Advanced Excel Exercises with Solutions!