Davealot
Member
Needing a moment of help if possible. I have one customers with varying part numbers, some have 10 digits, some have 12.
For example:
8791004190
8791004190a0
I've wrote a formula to attempt to place a dash every 5 digits for example:
87910-04190
87910-04190-a0
This is what I've wrote, with the intentions that the LEN formula would see if the cell was greater than 10 digits and if so return the final two digits and if not just return the ten digit modified part number:
=LEFT(A4,5)&"-"&MID(A4,6,5)&(IF(LEN(A4=12),RIGHT(A4,2),""))
However what is being returned on the ten digit numbers is
87910-0419090
Not sure what I'm doing wrong, specifically I know that I need to figure out how to correctly get it to tell the difference between a ten digit and twelve digit part number, and not sure how to correctly designate the second "-" in a twelve digit part number. Thanks for your help
For example:
8791004190
8791004190a0
I've wrote a formula to attempt to place a dash every 5 digits for example:
87910-04190
87910-04190-a0
This is what I've wrote, with the intentions that the LEN formula would see if the cell was greater than 10 digits and if so return the final two digits and if not just return the ten digit modified part number:
=LEFT(A4,5)&"-"&MID(A4,6,5)&(IF(LEN(A4=12),RIGHT(A4,2),""))
However what is being returned on the ten digit numbers is
87910-0419090
Not sure what I'm doing wrong, specifically I know that I need to figure out how to correctly get it to tell the difference between a ten digit and twelve digit part number, and not sure how to correctly designate the second "-" in a twelve digit part number. Thanks for your help