Excel stores fraction values as decimals in number format by default. But sometimes we may need to represent it as a stacked fraction for different purposes. So in this article, I’ll show 5 useful ways to add a stacked fraction in Excel.
Download Practice Workbook
You can download the free Excel workbook from here and practice on your own.
5 Ways to Add a Stacked Fraction in Excel
First, get introduced to our dataset that represents some Engineering Nut’s names and diameters in inches.
1. Using Fraction Format to Add a Stacked Fraction
In our very first method, we’ll learn the basic and simple way to add a stacked fraction in Excel, we’ll just change the format from number to fraction.
- First, select the cells C6:C10 and click Home > Number.
- Then click on the drop-down icon from the Number section and select Fraction from the appeared list.
Now have a look, Fraction format is showing the values as stacked fractions.
2. Custom Number Format to Add a Stacked Fraction in Excel
Also, there are some custom number formats in Excel by which we can get stacked fractions.
- Click on the Number Format icon from the Number section of the Home ribbon.
- After appearing the Format Cells dialog box, click on Fraction from the ‘Category box’.
- Then you will get some custom fraction formats in the ‘Type’ box. Choose one of them, I chose As quarters (2/4).
- Finally, just press OK.
The values are now converted to approximate quarter values.
3. Inserting Excel Equation to Add a Stacked Fraction
We know Excel has the Equation feature which can be used to add a stacked fraction. The Equation’s advantage is that it can change the presentation of a stacked fraction.
- Click as follows: Insert > Symbols > Equation.
- Later, click Equation > Fraction.
- Next, select any of your desired fraction types. I selected the first one.
- After that, type 1 in the numerator and 2 in the denominator positions.
- Then click anywhere out of the equation box and you will get the stacked fraction.
Following the same procedures, create the other stacked fractions.
4. Inserting Symbol to Add a Stacked Fraction
There are some built-in fraction symbols in Excel that you can use if they matched your required stacked fraction. The problem is- the fraction symbols are limited.
- First, select a cell and click as follows: Insert > Symbols > Symbol.
Soon after you will get a dialog box named ‘Symbol’.
- See, there are some fraction symbols in the dialog box, select one of them and click Insert.
The inserted symbol will look like the image below.
In the same way, insert the symbols into the other cells.
5. VBA Macro to Add a Stacked Fraction in Excel
By using Excel VBA Macro, we can make a stacked fraction differently. We can input the numerator and the denominator into two different cells and then use them to make a stacked fraction. I placed 22 as the numerator in Cell C5 and 7 as the denominator in Cell C7 and will show the stacked fraction in Cell C8.
- Press ALT + F11 to open the VBA window.
- Then click Insert > Module to open a new module.
- After that, type the following codes in it-
Option Explicit Sub Stacked_Fraction() ActiveCell.FormulaR1C1 = Range("C5") & Chr(10) & "—" & Chr(10) & Range("C6") With Selection .HorizontalAlignment = xlCenter .VerticalAlignment = xlBottom .WrapText = True .Orientation = 0 .AddIndent = False .IndentLevel = 0 .ShrinkToFit = False .ReadingOrder = xlContext .MergeCells = False End With End Sub
- Next, go back to your sheet.
- Select the cell where you want to get the fraction. I selected Cell C8.
- Then click as follows: Developer > Macros to open the Macros dialog box.
- At this moment, just select the Macro Name and press Run.
Here’s our stacked fraction after using the VBA macro.
I hope the procedures described above will be good enough to add a stacked fraction in Excel. Feel free to ask any question in the comment section and please give me feedback. Visit ExcelDemy to explore more.