sorry i put wrongly for padded leading 0

  • Thread starter Thread starter tango
  • Start date Start date
T

tango

dear all

this is to pad with trailing 0
=IF(D2<14, D2&REPT("0",14-LEN(D2)),D2)

why when i put in this way it doesn't seem to work?
=IF(D2<14, REPT("0",14-LEN(D2)&D2),D2)

thanks
 
I suspect you IF condition is written improperly -- I think this is what you
want.
=IF(LEN(D2)<14,REPT("0",14-LEN(D2))&D2,D2)
 

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

Similar Threads

padded leading 0 1
ModifyCellText 1
cell formula question 4
Formula Array? 5
VLookup and Indirect 3
Error when no records meet criteria - repost 3
object variable not set 5
Using Vlookup with IF statements 3

Back
Top