Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / April 2008

Tip: Looking for answers? Try searching our database.

Concatenate Problem

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
John Calder - 01 Apr 2008 21:45 GMT
Hi

I use WinXP with Excel 2000

I use a "helper" column in a linked spread sheet with approx 1200 lines of
data that is then used to generate a pivot table.

The formula in the helper colum is as follows:

=IF(VALUE(F984)=0,"",CONCATENATE(I984&"      [",B984&" DAYS ]"))

As you can see by the formula that I am adding a reference to another cell &
the word DAYS inside [] brackets from the text string in cell I984.

This works fine.

However as the original text string is of varying lengths the result is that
the data that I am concatenating is also staggered.

Example:

BLACK PB4W45855-PN84503-T      [  77 DAYS ]
BROWN PN3W45854-PN43009-T      [  36 DAYS ]
WHITE SPW0363X-PS13007-A      [  77 DAYS ]
E GREEN SPG0463X-PS53008-A      [  77 DAYS ]
RYSDALE BROWN-PN42789-D      [ 103 DAYS ]

What I would like to be able to do is have the concatenated data to be
"right aligned" in the cell while the original data stays left aligned.

Example:

BLACK PB4W45855-PN84503-T    [  77 DAYS ]
BROWN PN3W45854-PN43009-T    [  36 DAYS ]
WHITE SPW0363X-PS13007-A    [  77 DAYS ]
E GREEN SPG0463X-PS53008-A    [  77 DAYS ]
RYSDALE BROWN-PN42789-D    [ 103 DAYS ]

Is this possible?

Thanks

John
T. Valko - 01 Apr 2008 22:53 GMT
Can't you just remove all the extra spaces from the formula:

...CONCATENATE(I984&" [",B984&" DAYS ]"))

Or, am I missing something?

Signature

Biff
Microsoft Excel MVP

> Hi
>
[quoted text clipped - 41 lines]
>
> John
John Calder - 01 Apr 2008 23:23 GMT
Thanks for your prompt reply.

Removing the spaces does not make any differencce. I still would end up with
a staggerd text string.  What I am aiming for is to have the source text
string aligned to the left and the conctenated text strig to the right

Hope this helps

John

> Can't you just remove all the extra spaces from the formula:
>
[quoted text clipped - 47 lines]
> >
> > John
T. Valko - 01 Apr 2008 23:29 GMT
See Ron's reply. That should do what you want.

Signature

Biff
Microsoft Excel MVP

> Thanks for your prompt reply.
>
[quoted text clipped - 60 lines]
>> >
>> > John
Ron Rosenfeld - 01 Apr 2008 23:04 GMT
>Hi
>
[quoted text clipped - 35 lines]
>
>Is this possible?

If you can use a fixed-pitch font, then you can add in the appropriate number
of spaces using a formula.  This won't work with a proportionally spaced font,
in which case you'll need to get into calls that compute the actual character
width.  There's information about this on the 'net, but it's pretty complex.

You have to compute the proper number of spaces both before the "[" as well as
between the "[" and the number.

I used A19 and G19 for my sources, and Courier New for a font.

You may have to adjust the "30" and the "4" below depending on the range of
lengths of your data.

=IF(A19=0,"",CONCATENATE(A19,REPT(" ",30-LEN(A19)),"[",
REPT(" ",4-LEN(G19)),G19," DAYS]"))

--ron
John Calder - 01 Apr 2008 23:30 GMT
Thanks Ron

This sounds like a bigger job than I thought. I am having to do all this
because all my colums of data are unique records and Excel 2K cannot handle
more than 8,000 of these so I am having to combine 2 columns of data to
lessen the load on the pivot table.   I can probaly get by with what I have
(staggered text strings).

As this data is used for a pivot table that is viewed by a number of people
on server it would have been tidier to have the original text string aligned
to the left and the concatenated text string to the right.

I will give it a go and see how I go, thanks for your help

John

> >Hi
> >
[quoted text clipped - 53 lines]
>
> --ron
John Calder - 02 Apr 2008 01:01 GMT
Ron

Just to let you know, I done as you suggested and the outcome was
outstanding.....many thanks and well done !

> >Hi
> >
[quoted text clipped - 53 lines]
>
> --ron
Ron Rosenfeld - 02 Apr 2008 01:11 GMT
>Ron
>
>Just to let you know, I done as you suggested and the outcome was
>outstanding.....many thanks and well done !

You're welcome.  Glad to help.  Thanks for the feedback.
--ron
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.