General discussion

Locked

How can I truncate TEXT in Excel 97?

By lmc-tech ·
I had a user ask me how he can truncate text which he imports from the internet. The data goes into a cell with column width set at 20, but some of the cells have quite lengthy and variable text, such as a complete sentence. He only needs a portion of the text, say, up to what fits in column width 20. I know Excel has a function to truncate numerical data, but I can't find a function to truncate text. I wrote an if statement that checks the length of the cell's value and replaces all but the first 10 characters with blanks. Then he can copy and paste only the values from the 'working' column to the needed column. (FYI, This worksheet is uploaded to a mainframe file so it is critical that the data be massaged to fit the mainframe record layout.)

This conversation is currently closed to new comments.

3 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

How can I truncate TEXT in Excel 97?

by Peyison In reply to How can I truncate TEXT i ...

To truncate text, use the mid() function:

=MID(A1,1,20)

first parameter is the cell, second is the starting point of the string, third is the length to return

Hope this helps.

Collapse -

How can I truncate TEXT in Excel 97?

by Shanghai Sam In reply to How can I truncate TEXT i ...

Poster rated this answer

Collapse -

How can I truncate TEXT in Excel 97?

by lmc-tech In reply to How can I truncate TEXT i ...

This question was closed by the author

Back to Software Forum
3 total posts (Page 1 of 1)  

Related Discussions

Related Forums