Friday, May 29, 2009

MOSS SharePoint Formula example

This is an example of using a formula inside of a Microsoft SharePoint MOSS custom list, that will take a value from another column based upon where it finds a hyphen, and then formats the number with leading zeros.

For instance:
Source value is: "The Really Cool Company - C7"
The result coming out of the formula is: "C-007"

The practical use is to provide an attribute that can be used for alphabetic sorting, without having to perform a lot of data cleanup.

Formula:
=(MID(RIGHT(TRIM(Company),(LEN(TRIM(Company))-FIND("-",TRIM(Company)))),2,1))&"-"&(TEXT(MID(RIGHT(TRIM(Company),(LEN(TRIM(Company))-FIND("-",TRIM(Company)))),3,3),"000"))
Powered By Blogger