SOLVED

ICD 10 codes

Copper Contributor

Hello!

 

I am trying to add a period after the third character in the ICD codes but if there are no characters following the third character, I do not want to add a period. I have a picture of a sample file with highlighted data. The highlighted data is the data that I do not want a period after.

Any Suggestions?

username965_0-1677092483171.png

 

9 Replies

@username965 

=IF(LEN(D2)=3,D2,CONCATENATE(LEFT(D2,3),".",RIGHT(D2,LEN(D2)-3)))

You can try this formula which seems to return the expected result.

icd10 codes.JPG 

I tried that formula but it still seems to be giving me the period after the 3rd character for all values

@username965 

Does it work in the attached file and is the data in the left column of your screenshot the start data and the data in the right column the expected result?

 

Yes, that is correct. Left column is the start data and the right is the column with the expected result.

 

best response confirmed by Hans Vogelaar (MVP)
Solution

@OliverScheurich @username965  i suspect there is a space after the 3 character codes so try one of these:

 

 

 

=IF(LEN(TRIM(D2))<=3,D2,REPLACE(D2,4,0,"."))

 

 

EDIT: I created different 2nd option

=IF(MID(D2,4,1)<"  ",D2,REPLACE(D2,4,0,"."))

 

The first formula worked perfectly! Thank you so much!

@username965 

I agree with @mtarler 's solution. Thank you for your responses both.

Thank you so much for your help!!
1 best response

Accepted Solutions
best response confirmed by Hans Vogelaar (MVP)
Solution

@OliverScheurich @username965  i suspect there is a space after the 3 character codes so try one of these:

 

 

 

=IF(LEN(TRIM(D2))<=3,D2,REPLACE(D2,4,0,"."))

 

 

EDIT: I created different 2nd option

=IF(MID(D2,4,1)<"  ",D2,REPLACE(D2,4,0,"."))

 

View solution in original post