Modifying Names to Usernames

madrock

New Member
Joined
Nov 22, 2017
Messages
4
Hello All,

here is my excel problem.

Smith, John
Doe, Jane
Smithss, Jack
Whitess, John
Blackss, Jane
Bluesss, Peter
Longlastname, Phillip

I dont know if it's possible to have these converted to usernames. The format is 6/1 (first 6 character of last name and 1st character of first name)

of course if there isnt 6 characters of the last name it would be whatever is there like DOEJ

Is this possible?
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
Welcome to Mr Excel forum

Maybe this

[Table="class: grid"][tr][td="bgcolor: #DCE6F1"][/td][td="bgcolor: #DCE6F1"]
A
[/td][td="bgcolor: #DCE6F1"]
B
[/td][/tr]
[tr][td="bgcolor: #DCE6F1"]
1
[/td][td]
Name​
[/td][td]
Result​
[/td][/tr]

[tr][td="bgcolor: #DCE6F1"]
2
[/td][td]
Smith, John​
[/td][td]
SmithJ​
[/td][/tr]

[tr][td="bgcolor: #DCE6F1"]
3
[/td][td]
Doe, Jane​
[/td][td]
DoeJ​
[/td][/tr]

[tr][td="bgcolor: #DCE6F1"]
4
[/td][td]
Smithss, Jack​
[/td][td]
SmithsJ​
[/td][/tr]

[tr][td="bgcolor: #DCE6F1"]
5
[/td][td]
Whitess, John​
[/td][td]
WhitesJ​
[/td][/tr]

[tr][td="bgcolor: #DCE6F1"]
6
[/td][td]
Blackss, Jane​
[/td][td]
BlacksJ​
[/td][/tr]

[tr][td="bgcolor: #DCE6F1"]
7
[/td][td]
Bluesss, Peter​
[/td][td]
BluessP​
[/td][/tr]

[tr][td="bgcolor: #DCE6F1"]
8
[/td][td]
Longlastname, Phillip​
[/td][td]
LonglaP​
[/td][/tr]
[/table]


Formula in B2 copied down
=LEFT(LEFT(A2,SEARCH(",",A2)-1),6)&LEFT(TRIM(MID(A2,SEARCH(",",A2)+1,LEN(A2))))

Hope this helps

M.
 
Upvote 0
Marcelo,

You are a wizard!!! This is absolutely fantastic and it totally worked.

Thank you very very much!!

Peace
Phil
 
Upvote 0
Sorry.. I have a question.... where do I make the change to make it 6/2, 6/3 instead 6/1. If the usernames already exists I will need to make changes etc.

Thanks in advance!

Peace
Phil
 
Upvote 0
To check if the user already exists would make the formula very complicated (i think you would need VBA), so i suggest you use 6/3 to all names..

Something like
B2
=LEFT(LEFT(A2,SEARCH(",",A2)-1),6)&LEFT(TRIM(MID(A2,SEARCH(",",A2)+1,LEN(A2))),3)

M.
 
Upvote 0
I didnt explain the scenario correctly, but that formula you provide is exactly what i am looking for. I have to provide three proposed usernames (6/1, 6/2, and 6/3). I currently have about 100 names to work on and searching AD for that username takes way too much time (manually typing it out etc). This kick-*** formula that you provided allows me to just copy paste into AD and make any changes accordingly.

I may have other scenarios for usernames and if it's ok I will post here to keep it all in one place.

Thanks again and seriously... you have saved me a tremendous amount of time and I appreciate it!

Peace
Phil.
 
Upvote 0
You are welcome.

By the way, to create three lists, 6/1, 6/2 and 6/3, change the 3 (in red) in the formula above accordingly.

M.
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,289
Members
452,631
Latest member
a_potato

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.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

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

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

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
Back
Top