Insert comma to end of a cell

This tutorial shows how to add a comma (,) to the end of a cell through the use of an & sign and CONCATENATE function, or VBA

EXCEL FORMULA 1. Insert comma to end of a cell using the & sign

EXCEL

Hard coded formula
Insert comma to end of a cell
Cell reference formula
Insert comma to end of a cell
=B5&","
=B5&C5
GENERIC FORMULA

=cell&","

ARGUMENTS
cell: A cell at the end of which you want to insert a comma (,).

GENERIC FORMULA

=cell&comma

ARGUMENTS
cell: A cell at the end of which you want to insert a comma (,).
comma: A cell that contains the comma sign.

EXPLANATION

This formula uses the & sign to add a comma at the end of a cell.
Click on either the Hard Coded or Cell Reference button to view the formula that has the comma sign to be inserted directly entered into the formula or referenced to a specific cell that captures the comma sign.

In this example we are adding a comma at the end of a string captured in cell (B5).

EXCEL FORMULA 2. Insert comma to end of a cell using the CONCATENATE function

EXCEL

Hard coded formula
Insert comma to end of a cell
Cell reference formula
Insert comma to end of a cell
=CONCATENATE(B5,",")
=CONCATENATE(B5,C5)
GENERIC FORMULA

=CONCATENATE(cell,",")

ARGUMENTS
cell: A cell at the end of which you want to insert a comma (,).

GENERIC FORMULA

=CONCATENATE(cell,comma)

ARGUMENTS
cell: A cell at the end of which you want to insert a comma (,).
comma: A cell that contains the comma sign.

EXPLANATION

This formula uses the CONCATENATE function to insert a comma at the end of a string captured in a cell.
Click on either the Hard Coded or Cell Reference button to view the formula that has the comma sign to be inserted directly entered into the formula or referenced to a specific cell that captures the comma sign.

In this example we are adding a comma at the end of a string captured in cell (B5).

VBA CODE 1. Insert comma to end of a cell

VBA

Hard coded against single cell
Sub Insert_comma_to_end_cell()
'declare variables
Dim ws As Worksheet
Set ws = Worksheets("Analysis")
'insert a comma to end of a string
ws.Range("C5") = ws.Range("B5") & ","

End Sub

Cell reference against single cell
Sub Insert_comma_to_end_cell()
'declare variables
Dim ws As Worksheet
Set ws = Worksheets("Analysis")
'insert a comma to end of a string
ws.Range("D5") = ws.Range("B5") & ws.Range("C5")

End Sub

Hard coded against range of cells
Sub Insert_comma_to_end_cell()
'declare variables
Dim ws As Worksheet
Set ws = Worksheets("Analysis")

'insert a comma to end of a string
For x = 5 To 8

ws.Range("C" & x) = ws.Range("B" & x) & ","

Next x

End Sub

Cell reference against range of cells
Sub Insert_comma_to_end_cell()
'declare variables
Dim ws As Worksheet
Set ws = Worksheets("Analysis")

'insert a comma to end of a string
For x = 5 To 8

ws.Range("D" & x) = ws.Range("B" & x) & ws.Range("C" & x)

Next x

End Sub

RELATED TOPICS

Related Topic Description Related Topic and Description
How to insert a comma after each word through the use of an Excel formula or VBA
How to insert a comma before each word through the use of an Excel formula or VBA
How to add a full stop (.) to the end of a cell through the use of an Excel formula or VBA
How to concatenate a value to the end of a cell through the use of an Excel formula or VBA