View Single Post
  #3   Report Post  
swatsp0p
 
Posts: n/a
Default


Excel is simply displaying the zeros, which are not really there (try
=Len(A1) to see). Using that principle, we can test the length of A1
and add zeros as needed:

in cell A2:
=IF(LEN(A1)=4,"0"&A1&"XX",IF(LEN(A1)=3,"00"&A1&"XX ",A1&"XX"))

I am assuming no part code number is fewer than three 'true' digits
(00123)

HTH


--
swatsp0p


------------------------------------------------------------------------
swatsp0p's Profile: http://www.excelforum.com/member.php...o&userid=15101
View this thread: http://www.excelforum.com/showthread...hreadid=377081