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

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
Hi Jan

with your data in cell A2

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

Cheers
JulieD
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top