Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 03-09-2012, 06:39 AM
stovaaa stovaaa is offline Add _ based on a calculated colums Mac OS X Add _ based on a calculated colums Office for Mac 2011
Novice
Add _ based on a calculated colums
 
Join Date: Mar 2012
Posts: 3
stovaaa is on a distinguished road
Default Add _ based on a calculated colums


So I am creating new usernames for users in Excel. My format will look be AL11smitJ. The AL is the state the user resides in, the 11 is the Office location number, then I take the first four characters of the last name, and the first character of the first name. Here is the function I use:

=LOWER(CONCATENATE(J75,RIGHT(E75,2),LEFT(C75,4),LE FT(A75,1)))

My problem is that I need to lengthen last names that are less than four characters with underscores. I have a column that calculates the number of underscores needed to make the last name four characters long, but have no idea were to go from there.
Reply With Quote
  #2  
Old 03-09-2012, 07:23 AM
Pecoflyer's Avatar
Pecoflyer Pecoflyer is offline Add _ based on a calculated colums Windows XP Add _ based on a calculated colums Office 2003
Expert
 
Join Date: Nov 2011
Location: Brussels Belgium
Posts: 2,777
Pecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant future
Default

Don't know if it works on mac but you will get the idea

Code:
=LOWER(CONCATENATE(J75,RIGHT(E75,2),LEFT(C75,MIN(4,LEN(C75)),REPT("_",4-LEN(C75)),LEFT(A75,1)))
EDIT corrected formula missing parenthesis
__________________
Did you know you can thank someone who helped you? Click on the tiny scale in the right upper hand corner of your helper's post
Reply With Quote
  #3  
Old 03-09-2012, 07:49 AM
stovaaa stovaaa is offline Add _ based on a calculated colums Mac OS X Add _ based on a calculated colums Office for Mac 2011
Novice
Add _ based on a calculated colums
 
Join Date: Mar 2012
Posts: 3
stovaaa is on a distinguished road
Default

It looks like this taps out the max number of arguments Excel 2011 can handle. However, I see how you added the underscores. I will post the winning function when I get it done.
Reply With Quote
  #4  
Old 03-09-2012, 08:01 AM
Pecoflyer's Avatar
Pecoflyer Pecoflyer is offline Add _ based on a calculated colums Windows XP Add _ based on a calculated colums Office 2003
Expert
 
Join Date: Nov 2011
Location: Brussels Belgium
Posts: 2,777
Pecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant future
Default

Maybe you can replace concatenate with the "&"
=lower(J75&right(.....)&....

( if it works on MAC)
__________________
Did you know you can thank someone who helped you? Click on the tiny scale in the right upper hand corner of your helper's post
Reply With Quote
  #5  
Old 03-09-2012, 08:32 AM
stovaaa stovaaa is offline Add _ based on a calculated colums Mac OS X Add _ based on a calculated colums Office for Mac 2011
Novice
Add _ based on a calculated colums
 
Join Date: Mar 2012
Posts: 3
stovaaa is on a distinguished road
Default

Got it!! Since I don't care what the spreadsheet looks like when I am done I used some helper columns. Thanks Peco for the help, your REPT suggestion was exactly what I was looking for. I just applied it differently.
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Work calculated differently for two seemingly identical tasks SteveD Project 0 10-12-2011 02:05 PM
Add _ based on a calculated colums Calculated Field is disabled MariaAdc Excel 1 03-01-2011 02:44 AM
Add _ based on a calculated colums Calculated dates. Ziggy-R Word 10 09-28-2010 01:42 AM
multiple colums under a single column RobotChicken Excel 3 01-06-2010 09:17 AM
Using calculated field - WHY IS IT SO COMPLICATED? Riorin Word 0 10-30-2009 12:20 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:29 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft