Function Problems

Insert a Period After the Third Character of ICD-10 Codes in Excel

Natalie TaylorNatalie Taylor Nov 18, 2026 869 views

Question details

Insert a period after the third character of an ICD-10 code only when additional characters exist, accounting for trailing spaces.

Insert a Period After the Third Character of ICD-10 Codes in Excel
Product
Microsoft Excel
Device & OS
not provided
Scenario
A worksheet contains ICD-10 codes that need a decimal point before the fourth character.
Observed behavior
Codes longer than three characters should receive a period after the third character; shorter codes should remain unchanged.
Before you start

Identify the column containing your codes and choose an empty column for the results. Check that the codes do not already contain periods or leading spaces.

Solution 1Recommended

Use an Excel Formula to Insert the Period

Use this formula when the source codes are in column D and trailing spaces should not affect the length check.

1
Select an empty cell

Click E2, or another empty cell on the same row as the first code in D2.

2
Enter the formula

Type =IF(LEN(TRIM(D2))<=3,D2,REPLACE(TRIM(D2),4,0,".")) and press Enter.

3
Fill down

Drag the fill handle from E2 down alongside the remaining codes in column D.

4
Check the results

Confirm that a code such as E119 becomes E11.9 and a three-character code such as E11 remains unchanged.

Use an Excel Formula to Insert the Period
How spaces are handled: For codes longer than three characters, TRIM removes leading and trailing spaces and reduces repeated internal spaces. Codes of three or fewer characters are returned from the original cell, including any trailing spaces.
Format ICD-10 codes

Format ICD-10 Codes in WPS Spreadsheets

Use a formula in WPS Spreadsheets to insert a period after the third character of longer ICD-10 codes while leaving shorter codes unchanged.

  1. 1. Open the worksheet: Open WPS Spreadsheets and select Open to load the file containing the ICD-10 codes.
  2. 2. Choose a result cell: Click an empty cell such as E2 next to the first code in D2.
  3. 3. Enter the formula: Enter =IF(LEN(TRIM(D2))<=3,D2,REPLACE(TRIM(D2),4,0,".")) and press Enter.
  4. 4. Fill the column: Drag the fill handle down from E2 to apply the formula to the other rows.
Format a column of ICD-10 codes with a fill-down formulaOpen and save Microsoft Excel XLSX filesUse familiar spreadsheet functions and controlsWork with spreadsheets using the free WPS Office suite
microsoft office alternative - wps office

Frequently Asked Questions

Will the formula add a period to a three-character code?

No. The IF function checks the length after TRIM removes surrounding spaces. If the trimmed code has three or fewer characters, it returns the original cell unchanged.

What happens if a code already contains a period?

The formula does not check for an existing period, so it can add another one. Check the source column and remove existing periods before applying it.

How can I keep trailing spaces in longer codes?

Use =IF(LEN(TRIM(D2))<=3,D2,REPLACE(D2,4,0,".")) in an empty cell. Make sure the source codes have no leading spaces, because the insertion position is based on the original cell.

How do I apply the formula to an entire list?

Enter the formula next to the first code, then drag the result cell's fill handle down to the last row. Excel or WPS Spreadsheets will adjust the cell reference for each row.