Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4
Default Text with repeating trailing spaces

I need to create a text string from several different values that I have
calculated, however I need the resulting string to be fixed width (ie. the
first entry needs to be inserted followed by spaces to total 30 characters).
I know it can be done as I did this previously, but forget how. Can anybody
help?
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,058
Default Text with repeating trailing spaces

=A1 & REPT(" ",30-LEN(A1))

--
Gary''s Student - gsnu200837
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default Text with repeating trailing spaces

=F5&REPT(" ",30-(LEN(F5)))

You haven't said what to do with remaining "several values" in the string
but just keep '&'ing


Gord Dibben MS Excel MVP

On Mon, 9 Mar 2009 11:28:01 -0700, briancrosier
wrote:

I need to create a text string from several different values that I have
calculated, however I need the resulting string to be fixed width (ie. the
first entry needs to be inserted followed by spaces to total 30 characters).
I know it can be done as I did this previously, but forget how. Can anybody
help?


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35,218
Default Text with repeating trailing spaces

=left(a1&rept(" ",30),30)

Will truncate/pad the string in A1 at 30 characters.

briancrosier wrote:

I need to create a text string from several different values that I have
calculated, however I need the resulting string to be fixed width (ie. the
first entry needs to be inserted followed by spaces to total 30 characters).
I know it can be done as I did this previously, but forget how. Can anybody
help?


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4
Default Text with repeating trailing spaces

Thnaks every body, it was the REPT function that I had forgotten.

"Dave Peterson" wrote:

=left(a1&rept(" ",30),30)

Will truncate/pad the string in A1 at 30 characters.

briancrosier wrote:

I need to create a text string from several different values that I have
calculated, however I need the resulting string to be fixed width (ie. the
first entry needs to be inserted followed by spaces to total 30 characters).
I know it can be done as I did this previously, but forget how. Can anybody
help?


--

Dave Peterson

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
trailing spaces peter Excel Worksheet Functions 3 October 18th 07 11:32 PM
Removing leading/trailing spaces Chuda Excel Discussion (Misc queries) 2 September 12th 06 04:20 PM
REMOVING TRAILING SPACES Tris Excel Discussion (Misc queries) 5 August 29th 06 03:36 PM
remove trailing spaces les8 Excel Discussion (Misc queries) 4 January 20th 06 03:55 PM
how do I remove empty spaces trailing a text string? Need_Help Excel Worksheet Functions 2 June 7th 05 12:13 AM


All times are GMT +1. The time now is 01:59 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"