Return all characters after nth character

This tutorial shows how to extract all characters after the nth character from a string through the use of an Excel formula, with the MID and LEN functions or VBA

EXCEL FORMULA 1. Return all characters after nth character using the MID and LEN functions

EXCEL

Hard coded formula
Return all characters after nth character
Cell reference formula
Return all characters after nth character
=MID(B5,3+1,LEN(B5))
=MID(B5,C5+1,LEN(B5))
GENERIC FORMULA

=MID(string,nth_char+1,LEN(string))

ARGUMENTS
string: The string from which you want to return all of the characters from a string after the nth character.
nth_char: A number which represents after which nth character you want to extract from.

GENERIC FORMULA

=MID(string,nth_char+1,LEN(string))

ARGUMENTS
string: The string from which you want to return all of the characters from a string after the nth character.
nth_char: A number which represents after which nth character you want to extract from.

EXPLANATION

This formula uses the MID and LEN functions to extract all of the characters from a string after the nth character.
Click on either the Hard Coded or Cell Reference button to view the formula that either has the number that represents the nth character after which you want to extract all the characters from a string entered directly in the formula or referenced to a cell.

In this example we are extracting all of the characters after the third (3rd) character, from the left, from a string captured in cell B5.

VBA CODE 1. Return all characters after nth character using VBA

VBA

Hard coded against single cell
Sub Return_all_characters_after_nth_character()
'declare variables
Dim ws As Worksheet
Set ws = Worksheets("Analysis")
'extract all character after the 3rd character from a string
ws.Range("C5") = Mid(ws.Range("B5"), 3 + 1, Len(ws.Range("B5")))

End Sub

Cell reference against single cell
Sub Return_all_characters_after_nth_character()
'declare variables
Dim ws As Worksheet
Set ws = Worksheets("Analysis")
'extract all character after the 3rd character from a string
ws.Range("D5") = Mid(ws.Range("B5"), ws.Range("C5") + 1, Len(ws.Range("B5")))

End Sub

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

'extract all character after the 3rd character from a string

For x = 5 To 8

ws.Range("C" & x) = Mid(ws.Range("B" & x), 3 + 1, Len(ws.Range("B" & x)))
Next x

End Sub

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

'extract all character after the 3rd character from a string

For x = 5 To 8

ws.Range("D" & x) = Mid(ws.Range("B" & x), ws.Range("C" & x) + 1, Len(ws.Range("B" & x)))
Next x

End Sub

RELATED TOPICS

Related Topic Description Related Topic and Description
How to extract the nth character from a string through the use of an Excel formula or VBA
How to extract all characters after and including the nth character from a string through the use of an Excel formula or VBA
How to insert a value after the last nth character through the use of an Excel formula or VBA

RELATED FUNCTIONS

Related Functions Description Related Functions and Description
The Excel MID function returns the specified number of characters from a selected string, starting at a specified position
The Excel LEN function returns the number of characters in a specified string