# Find nth occurrence of character

=FIND(CHAR(160),SUBSTITUTE(text,"@",CHAR(160),N))

To find the nth occurrence of a character in a text string, you can use a formula based on the FIND and SUBSTITUTE functions. In the example shown, the formula in D5 is:

=FIND(CHAR(160),SUBSTITUTE(B5,"@",CHAR(160),C5))

In this example we are looking for the nth occurrence of the "@" character.

Working from the inside out, we first use the SUBSTITUTE function to replace the nth occurrence of "@" with CHAR(160):

SUBSTITUTE(B5,"@",CHAR(160),C5)

The SUBSTITUTE function has an optional 4th argument called instance number that can be used to specify the instance that should be replaced. This number comes from column C.

SUBSTITUTE then replaces the nth occurrence of "@" with CHAR(160), which resolves to "†". We use CHAR(160) because it won't normally appear in text. You can use any character you know won't exist in the text. For a demo of the CHAR function, see this video.

Finally, the FIND character looks for CHAR(160) and returns the position.

*Note: I developed this example on a Mac originally, where CHAR(160) resolves to a dagger (†). On Windows, use CHAR(134) for a dagger character.*

## Excel Formula Training

Formulas are the key to getting things done in Excel. In this accelerated training, you'll learn how to use formulas to manipulate text, work with dates and times, lookup values with VLOOKUP and INDEX & MATCH, count and sum with criteria, dynamically rank values, and create dynamic ranges. You'll also learn how to troubleshoot, trace errors, and fix problems. Instant access. See details here.

## Download 200+ Excel Shortcuts

Get over 200 Excel shortcuts for Windows and Mac in one handy PDF.