#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15
Default Formating Question

I have a long lists for of stores that contain texta and a number. I am
doing a Vlookup for this column but the formating is wrong. Here are
examples of what the two different texts look like. WalMart #01323 and
WALMART #001323 CARBONDALE (77757) Carbondale, IL. Is there a way to format
all of my cells in the second column to look like WalMart #01323? They arein
order but I can't drap because some of the numbers dont exsist.


Any help would be great

Adam


  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,203
Default Formating Question

I'm not sure I understand completely.

If the entries are like "WALMART #001323" and "WALMART #01323", and you want
them to all only have the 5 numbers, then try this:

On that sheet, in an unused column, put a formula like this on the same row
(assumes row 2 and original entries in column A) with the first entry:
=LEFT(A2,FIND("#",A2)) & RIGHT(A2,5)
and fill it down. All entries would be reduced to "WALMART #01323"-like
entries.

Next select all of those cells and use Edit -- Copy. Then choose all the
cells with the original entries in them and use Edit -- Paste Special and
choose the "Values" option. The original entries will be overwritten with
the new ones.


But if you have both types of entries in the column, then a really ugly
formula is needed:
=LEFT(LEFT(A2 & " ",FIND(" ",A2 & " ",FIND(" ",A2 & "
")+1)-1),FIND("#",LEFT(A2 & " ",FIND(" ",A2 & " ",FIND(" ",A2 & " ")+1)-1)))
& RIGHT(LEFT(A2 & " ",FIND(" ",A2 & " ",FIND(" ",A2 & " ")+1)-1),5)

Do the same thing with it. That will take entries like
WALMART #01323
WALMART #001323
and
WALMART #001323 CARBONDALE (77757) Carbondale, IL.
and reduce them to "WALMART #01323"
It does depend on their being a # symbol in the original entry and at least
5 characters after that before a space appears. For entries that are exactly
like "WALMART #01323" it does add the needed space after the 5 digits so that
it works properly.



"amik" wrote:

I have a long lists for of stores that contain texta and a number. I am
doing a Vlookup for this column but the formating is wrong. Here are
examples of what the two different texts look like. WalMart #01323 and
WALMART #001323 CARBONDALE (77757) Carbondale, IL. Is there a way to format
all of my cells in the second column to look like WalMart #01323? They arein
order but I can't drap because some of the numbers dont exsist.


Any help would be great

Adam


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
Conditional Formating (?) question mmills421 Excel Discussion (Misc queries) 12 May 8th 08 10:00 PM
Formating Question carl Excel Worksheet Functions 7 November 16th 07 08:31 PM
Conditinal Formating question carrera Excel Discussion (Misc queries) 8 December 1st 06 11:24 PM
Formating question toot033 Excel Discussion (Misc queries) 2 August 9th 06 06:35 PM
Formating Question Please Bob Newman Excel Discussion (Misc queries) 2 February 13th 06 02:33 PM


All times are GMT +1. The time now is 02:44 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"