1

I need to pad a numeric string using a SharePoint calculated column. I have two fields, Sectiontxt and calcPadNum. For example, if a user enters 1.12.1 into Sectiontxt, I want calcPadNum to be 011201.

I know that IF(LEN(ModuleNum)<2,0&ModuleNum,ModuleNum) will test if the length of ModuleNum field is less than 2, and if it is, it will add a 0 before it.

*I am using MOSS 2007, and I read here that the MID function is not supported. Is there any other (functional) option that I can use?

I know that I could add the following fields to the list ModuleNum, SectionNum, Sub_SectionNum, and then pad the number that way, but I am trying to avoid having the user enter the same info in multiple fields.

Many Thanks!

2
  • Okay, so I think it IS possible using the FIND() function, but it is going to be a seriously nested function... and nested functions are not my best. [link] (sharepoint.stackexchange.com/questions/29140/…) Anyone?
    – jg100309
    Commented Oct 18, 2013 at 15:57
  • Okay, so I'm back to my original plea. It looks like the FIND() function isn't going to help, since it only finds the first "." and doesn't go any farther, and there can be several "." that are entered.
    – jg100309
    Commented Oct 18, 2013 at 16:18

1 Answer 1

1

From your link it seems that you are using SP2010. This post indicates that MID() should work.

You might try &TEXT(ModuleNum,"00")

in place of

0&ModuleNum

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.