Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 846
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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 193
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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
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


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
Display only n numbers of characters for long text? Astro Excel Worksheet Functions 1 November 4th 08 08:03 AM
Extracting certain characters from a long string Stan in South Africa Excel Worksheet Functions 4 June 26th 08 08:35 PM
Validation - Precede with LR and between 6 and 9 characters long. forevertrying Excel Discussion (Misc queries) 6 May 8th 08 11:45 PM
How to enter a long address to new web query Pivotrend Excel Discussion (Misc queries) 5 September 2nd 05 11:36 AM
long address list, name-address-city, listed vertically, how do y. kb Excel Discussion (Misc queries) 2 March 4th 05 12:48 AM


All times are GMT +1. The time now is 08:57 PM.

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

About Us

"It's about Microsoft Excel"