Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
kb_63
 
Posts: n/a
Default Search a Column by text length

I have a large worksheet, which the data was imported. In column C of the
worksheet the text ranges from 8 characters to 11 characters in length. I
need to have all the text in column C to be 10 characters long. Is there a
way to search column C for all cells that don't equal 10 characters long? I
would also like it to stop at each cell that doesn't equal 10 characters so I
can correct the cell. Somewhat like a find and replace. Thank You for your
time.
  #2   Report Post  
Bob Tarburton
 
Posts: n/a
Default

Hi kb

=LEN(C1)
will return the number of characters in C1.
If you copy that down in Column D you can serch that.
OR
=if(LEN(C1)=11,LEFT(C1,10),C1&if(LEN(C1)<9," ","")&if(LEN(C1)<10,"
",""))
will remove the last character if the text is 11 characters or add
spaces up to 10 characters if less than 10 characters (but only within
your 8 to 11 character parameters)

Bob

On Fri, 6 May 2005 12:32:01 -0700, "kb_63"
wrote:

I have a large worksheet, which the data was imported. In column C of the
worksheet the text ranges from 8 characters to 11 characters in length. I
need to have all the text in column C to be 10 characters long. Is there a
way to search column C for all cells that don't equal 10 characters long? I
would also like it to stop at each cell that doesn't equal 10 characters so I
can correct the cell. Somewhat like a find and replace. Thank You for your
time.


  #3   Report Post  
Rob
 
Posts: n/a
Default

You need to convert the entire column to the desired length all at once, if
possible, I am assuming.

If you're just going to truncate the text, here's how:


Insert a helper column to the right of the text column.
put this formula in all the cells in the helper column: =MID(A1,1,8)

What this does is reurn the charracters in the text starting a 1, and
returning the next 8 characters

If you need to 'fix' the text in some other way, please specify, perhaps one
of us can help.

Rob


"kb_63" wrote:

I have a large worksheet, which the data was imported. In column C of the
worksheet the text ranges from 8 characters to 11 characters in length. I
need to have all the text in column C to be 10 characters long. Is there a
way to search column C for all cells that don't equal 10 characters long? I
would also like it to stop at each cell that doesn't equal 10 characters so I
can correct the cell. Somewhat like a find and replace. Thank You for your
time.

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
Return Count for LAST NonBlank Cell in each Row Sam via OfficeKB.com Excel Worksheet Functions 12 April 17th 05 10:36 PM
Changing column size w/o losing text Carrie New Users to Excel 3 April 13th 05 08:53 PM
Counting NUMBERS &/or TEXT from a column to other sheet ? Trixie Excel Worksheet Functions 4 March 3rd 05 07:59 PM
How can I make Excel return the text in column A only if there is. phatbusa Excel Worksheet Functions 1 January 26th 05 04:25 PM
Macro or Function to make text size to suite text Length? lbbss Excel Discussion (Misc queries) 4 December 14th 04 07:53 PM


All times are GMT +1. The time now is 04:14 AM.

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"