How to Add a Text Prefix with a Custom Format in Excel – 4 Examples

This is an overview:

Insertion of Text Prefix with Custom Format in Excel

Example 1 – Add a Designation Prefix

Steps:

  • Select D5:D14.
  • Press Ctrl+1.

Selection of column for Custom Format for Text Prefix

  • In the Format Cells window, go to Number.
  • Choose Custom in Category.
  • In Type:, enter the formula.
"Dr." @
  • Click OK.

Addition of formula for Prefix in the Custom tab

  • Select C5:C14 and Copy the data by pressing Ctrl + C.

Selection of data that are going to use Prefix

  • Select D5 and right-click. Paste the copied data as Values.

Pasting the copied data as Values

This is the output.

Outcome of adding Prefix

Read More: How to Add Prefix Without Formula in Excel


Example 2 – Adding a Currency Prefix

Steps:

  • Select D5:D14.
  • In the Home tab, click the icon as shown below.

Going to Custom format option for Text Prefix

  • In the Format Cells window, go to Number.
  • Choose Custom in Category.
  • In Type:, enter the formula.
$ 0000
  • Click OK.

Addition of formula

  • Select C5:C14 and Copy the data by pressing Ctrl + C.
  • Select D5 and right-click. Paste the copied data as Values.

This is the output.

Result of addition of currency sign as Text Prefix


Example 3 – Insert a Metric System Text Prefix with a Custom Format

Steps:

  • Select D5:D14.
  • Right click and select Format Cells.

Method of accessing Format Cells

  • Go to Number.
  • Choose Custom in Category.
  • In Type:, enter the formula.
"m" @
  • Click OK.

apply "m" (milli) as text prefix with custom format

  • Select C5:C14 and Copy the data by pressing Ctrl + C.
  • Select D5 and right-click. Paste the copied data as Values.

This is the output.

Outcome of adding mili(m) as text prefix


Example 4 – Adding a Text Prefix with a Custom Format Using Excel VBA

Steps:

  • Open the worksheet.
  • Go to the Developer tab and click Visual Basic.

Going to the developer option to execute VBA Code

  • Select Insert and click Module.

Going to the module section for adding the code

  • Copy the code:
Sub SOFTEKOaddPrefix()
Dim i As Integer
Dim n
Dim p
Dim result
For i = 5 To 14
p = Cells(i, 2).Value
n = Cells(i, 3).Value
Cells(i, 4).Value = p & " " & n
result = Cells(i, 4).Value
Next
End Sub
  • Press F5 or click Run to run the code.

Running VBA code for adding Text Prefix

  • This is the output.

Outcome of the addition of VBA code

Read More: How to Add Prefix to Entire Column in Excel


How to Add a Suffix with a Custom Format in Excel

Steps:

  • Select D5:D14
  • Press Ctrl+1.
  • In Format Cells, go to Number.
  • Choose Custom in Category.
  • In Type:, enter the formula.
00"Kg"

Addition of suffix formula

  • Click OK.
  • Select C5:C14 and Copy the data by pressing Ctrl + C.
  • Select D5 and right-click. Paste the copied data as Values.

This is the output.

Outcome of Addition of suffix to the data and texts

Read More: How to Add Suffix Without Formula in Excel


Download Practice Workbook

Download the practice workbook.


Related Articles


<< Go Back to Suffix and Prefix | Text Formatting | Learn Excel

Get FREE Advanced Excel Exercises with Solutions!
Zahid Shuvo
Zahid Shuvo

Zahid Hasan Shuvo, a Naval Architecture and Marine Engineering graduate from BUET, Bangladesh, has contributed nearly a year to the Exceldemy Project as an Excel and VBA Content Developer. Within this timeframe, he has crafted over 8 tutorial articles, and besides offering valuable solutions to aid users effectively. Zahid also expresses keen interests in Excel & VBA, Data Analysis, Machine Learning, AI Engines, and Prompt Engineering, showcasing a diverse skill set and contributing to the dynamic environment of... Read Full Bio

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo