A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Worksheet Functions
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Address must be 18 characters long



 
 
Thread Tools Display Modes
  #1  
Old May 27th, 2010, 10:54 PM posted to microsoft.public.excel.worksheet.functions
Derek M[_2_]
external usenet poster
 
Posts: 18
Default Address must be 18 characters long

Hi all again

I need the address to be 18 characters long i.e. if the address is over 18
characters then chop it, if its under, then add spaces

Is this possible?

Thanks as always

Derek
  #2  
Old May 27th, 2010, 11:06 PM posted to microsoft.public.excel.worksheet.functions
Brad
external usenet poster
 
Posts: 943
Default Address must be 18 characters long

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

This will add spaced at the end

if you want spaces in front
=right(rept(" ",18)&a1,18)

--
Wag more, bark less


"Derek M" wrote:

Hi all again

I need the address to be 18 characters long i.e. if the address is over 18
characters then chop it, if its under, then add spaces

Is this possible?

Thanks as always

Derek

  #3  
Old May 28th, 2010, 01:54 PM posted to microsoft.public.excel.worksheet.functions
Steve Dunn
external usenet poster
 
Posts: 192
Default Address must be 18 characters long

that second formula would result in the last 18 characters of the address if
A1 was already longer than that.

=left(rept(" ",max(0,18-len(a1)))&a1,18)



"Brad" wrote in message
...
=left(a1&rept(" ",18),18)

This will add spaced at the end

if you want spaces in front
=right(rept(" ",18)&a1,18)

--
Wag more, bark less


"Derek M" wrote:

Hi all again

I need the address to be 18 characters long i.e. if the address is over
18
characters then chop it, if its under, then add spaces

Is this possible?

Thanks as always

Derek


  #4  
Old June 1st, 2010, 01:06 PM posted to microsoft.public.excel.worksheet.functions
Derek M[_2_]
external usenet poster
 
Posts: 18
Default Address must be 18 characters long

Fantastic, thanks guys

"Steve Dunn" wrote:

that second formula would result in the last 18 characters of the address if
A1 was already longer than that.

=left(rept(" ",max(0,18-len(a1)))&a1,18)



"Brad" wrote in message
...
=left(a1&rept(" ",18),18)

This will add spaced at the end

if you want spaces in front
=right(rept(" ",18)&a1,18)

--
Wag more, bark less


"Derek M" wrote:

Hi all again

I need the address to be 18 characters long i.e. if the address is over
18
characters then chop it, if its under, then add spaces

Is this possible?

Thanks as always

Derek


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 10:19 PM.


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