Custom Fomat

  • Thread starter Thread starter CraigH
  • Start date Start date
C

CraigH

I would like to change for way a list of part numbers is
formatted to a "7-4" format. See example below

Current Desired
1234567-4 1234567-0004 adds leading zeros to dash#
1234567-24 1234567-0024 adds leading zeros to dash#
M485743895A M485743895A does not change
 
Hi

Hope this will be able to help; where A1 is where the
part number is stored.
=IF(ISNUMBER(FIND("-",A1))=FALSE,A1,MID(A1,1,SEARCH("-
",A1)-1)) &"-" & TEXT(VALUE(RIGHT(A1,LEN(A1)-SEARCH("-
",A1))),"0000")
 
Back
Top