# Can you help me adjust this formula? Need to remove part of it if cirteria exists

#### TWTHOMAS

##### Board Regular
I am splitting employee names to use for filling forms.

Currently I have employee names in column A like this

Jones, Thomas J
Smith, Susan
Jackson, Michael E JR
Wilson, Dan SR

I use this formula to create the field that only contains the middle intial

=TRIM(MID(SUBSTITUTE(\$A2," ",REPT(" ",LEN(\$A2))),((COLUMNS(\$A2:C2)-1)*LEN(\$A2))+1,LEN(\$A2)))&"."

However when Susans field populates I get a period even though she doesn't have a middle inital.
So her form looks like

Susan . Smith

Is there an adjustment I can make so when there is no middle initial I don't get a period?

### Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
Maybe

=SUBSTITUTE(TRIM(MID(SUBSTITUTE(\$A2," ",REPT(" ",LEN(\$A2))),((COLUMNS(\$A2:C2)-1)*LEN(\$A2))+1,LEN(\$A2)))&".",".","")

Just substitute null for any full stops in the result of your formula.

Maybe

=SUBSTITUTE(TRIM(MID(SUBSTITUTE(\$A2," ",REPT(" ",LEN(\$A2))),((COLUMNS(\$A2:C2)-1)*LEN(\$A2))+1,LEN(\$A2)))&".",".","")

Just substitute null for any full stops in the result of your formula.

This didn't work. It removes the period completely even if there is a middle initial.

Replies
13
Views
640
Replies
1
Views
201
Replies
5
Views
6K

1,196,081
Messages
6,013,318
Members
441,760
Latest member
Sharina

### We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.

### Which adblocker are you using?

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

### Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

### Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back