We will use the following dataset which displays the buying price and selling price of some products.
Method 1 – Changing Cell Format to Add Brackets to Negative Numbers
Steps:
- We will calculate the expected profit or loss from our data set.
- Enter the following formula into cell D5:
=B5-C5
- Press Enter to see the result.
- Use the AutoFill feature to drag the formula for the lower cells of the same column.
- You will notice negative numbers in the data set after calculation.
- We will add brackets to these numbers.
- Select all the numbers from cell range D5:D10.
- Right-click on the mouse after selecting the cell range.
- Select the Format Cells… command.
- You will see the Format Cells dialogue box.
- Go to the Number tab of the box.
- Choose the Number option.
- Choose the command (1234.10), which is in black.
- Press OK.
- You will see all the negative numbers in column D are in brackets and black.
- If you want to change the color of the negative numbers with brackets, go to the Number options from the Format Cells dialogue box.
- Choose the command (1234.10) in red.
- Press OK.
- You will see all the negative numbers in brackets, and they are red.
Read More: How to Put Negative Percentage Inside Brackets in Excel
Method 2 – Customizing Format Cells Box to Add Brackets to Negative Numbers
Steps:
- Select the cell range where you want to add brackets. Here, the cell range is D5:D10.
- Go to the Home tab.
- In the Number group, choose the little arrow on the lower-right side of the group.
- You will see the Format Cells dialogue box.
- Go to the Custom tab from the box.
- From the tab, choose the command #,##0.00_);(#,##0.00).
- Press OK.
- This command will add brackets to the negative numbers in the dataset. They will be black.
- If you want your bracketed negative numbers in red color, choose the #,##0.00_);[Red](#,##0.00) command from the Format Cells dialogue box.
- Press OK.
- This command will show all the negative numbers in red with brackets.
Read More: Excel Negative Numbers in Brackets and Red
Method 3 – Applying VBA to Add Brackets to Negative Numbers
Steps:
- Go to the Developer tab of the ribbon.
- Choose the Visual Basic command from the Code group of the tab.
- You will see the VBA window after selecting the command.
- From the Insert tab, choose Module.
- Enter the following VBA code in the module:
'Set the Function Name
Sub Add_Brackets_to_Negative_Numbers()
'Select the Cell range where the negative numbers are
Range("D5:D10").Select
'Set the format of the cells after adding brackets
Selection.NumberFormat = "0.00_);[Red](0.00)"
End Sub
- The function name is Add_Brackets_to_Negative_Numbers.
- Range(“D5:D10”). Select: Select the cell range where the negative numbers are located.
- Selection.NumberFormat = “0.00_);[Red](0.00)”: Add brackets to negative numbers and set their font color as red.
- Save the code and press the play button or F5 to run the code.
- You will see all the negative numbers in brackets after running the code.
Read More: Excel Formula for Working with Positive and Negative Numbers
Download the Practice Workbook
You can download the free Excel workbook here.
Related Articles
- How to Make Negative Numbers Red in Excel
- How to Put Parentheses for Negative Numbers in Excel
- How to Sum Negative and Positive Numbers in Excel
- How to Change Positive Numbers to Negative in Excel
- How to Move Negative Sign at End to Left of a Number in Excel
<< Go Back to Negative Numbers in Excel | Number Format | Learn Excel
Get FREE Advanced Excel Exercises with Solutions!