fill or truncate to a certain number of characters in a cell

J

Jan Buckley

I need to convert cells containing text to exactly 12 characters either by
truncating or filling with spaces. Does anyone know a formula that will do
that? Thanks.

Jan Buckley
 
J

JulieD

Hi Jan

with your data in cell A2

=IF(LEN(A2)>12,LEFT(A2,12),A2 & REPT(" ",12-LEN(A2)))

Cheers
JulieD
 
Top