Jump to content

Recommended Posts

Posted

Good morning all.

I hope someone can help me. Over the summer holidays I need to add a first name and a surname of many students into our active directory. Rather than go though each student and manually type the names I thought I would create a excel document and use the DSMOD USER command although I have bumped into a slight problem. Does anyone know how to separate the username into a first and surname? For example:

 

Username: 12james.smith

 

I need the above to change to James Smith

 

I have used the formula =LEFT(A17,FIND(”.“,A17)-1) but no joy.

 

Thanks in advance.

Posted

Thanks pcstru,

 

12 is the year of entry so I basically need to remove the year and just have the students username split into a first and surname.

 

So far I have managed to remove the year using =REPLACE(A5,1,2," ") but no joy in replacing the full stop with a space.

 

Thanks again for your help.

Posted

I think I may have fixed it using a very long winded way round:

 

To seprate the year I used: =REPLACE(A4,1,2,"")

To remove the full stop, in the next cell I used: =SUBSTITUTE(E4,"."," ")

Then to split the first name: =LEFT(G4,FIND(" ",G4)-1)

and finally the surname: =RIGHT(G4,LEN(G4)-FIND(" ",G4))

 

Now to concatenate. Wish me luck. Thanks for all your help.

Posted (edited)
I think I may have fixed it using a very long winded way round:

 

To seprate the year I used: =REPLACE(A4,1,2,"")

To remove the full stop, in the next cell I used: =SUBSTITUTE(E4,"."," ")

Then to split the first name: =LEFT(G4,FIND(" ",G4)-1)

and finally the surname: =RIGHT(G4,LEN(G4)-FIND(" ",G4))

 

Now to concatenate. Wish me luck. Thanks for all your help.

 

A1 = 12james.smith

 

=SUBSTITUTE(RIGHT(A1,LEN(A1)-2),"."," ")

 

If you want the outputted forename surname to be Forename Surname then the below functions

 

=PROPER(SUBSTITUTE(RIGHT(A1,LEN(A1)-2),"."," "))

 

you don't require both - just so you can do this in one cell instead of using multiple cells :)

Edited by mac_shinobi
  • Thanks 1
Posted

To separate james.smith into "james" & "smith" in separate columns:

Highlight column

Select data --> text to columns

Choose "delimited" then next

For the delimeter type in the fullstop

Click next & finish and Robert is your mothers brother.

 

The text to columns function is often very useful. You could also get rid of the "12" by first using text to columns fixed width, then separate the names as above.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...