I have a column of project numbers that vary in length. My plan is to write an IF statement to check the length of the Project Number and pad these numbers with 0 so that the formats are the same, max length of 10, if needed.
[TABLE="width: 500"]
<tbody>[TR]
[TD]Current Project Number[/TD]
[TD]New Proj Num[/TD]
[/TR]
[TR]
[TD]PRJ3[/TD]
[TD]PRJ0000003[/TD]
[/TR]
[TR]
[TD]PRJ0000012[/TD]
[TD]PRJ0000012[/TD]
[/TR]
</tbody>[/TABLE]
I'm using the MID & Format functions to find the location to start padding but it's not working for me.
Using the code above will give a result of 3 and 0000012 for the 2 examples above.
I'm using the PowerPivot plugin for Excel 2010 (version 11.0.5058.0). I appreciate the help!
[TABLE="width: 500"]
<tbody>[TR]
[TD]Current Project Number[/TD]
[TD]New Proj Num[/TD]
[/TR]
[TR]
[TD]PRJ3[/TD]
[TD]PRJ0000003[/TD]
[/TR]
[TR]
[TD]PRJ0000012[/TD]
[TD]PRJ0000012[/TD]
[/TR]
</tbody>[/TABLE]
I'm using the MID & Format functions to find the location to start padding but it's not working for me.
Code:
=FORMAT(MID([ProjectNumber],4,len([ProjectNumber])),"0000000")
Using the code above will give a result of 3 and 0000012 for the 2 examples above.
I'm using the PowerPivot plugin for Excel 2010 (version 11.0.5058.0). I appreciate the help!