简体   繁体   中英

Sharepoint Calculated Formula

Good day,

I'm having troubles with Sharepoint Column Calculated value. This column is used to create computer code depending on company, office, name first letter and surname first 5 letters, the problem is that Lithuanian names has lithuanian letters. So I need this formula to replace name and surname letters Ą to A, Č to C, Ę to E, Ė to E, Į to I, Š to S, Ų to U, Ū to U, Ž to Z . For example depending on my name, my computer code is GRIADMAMAKŠE , but I need it to generate GRIADMAMAKSE . Thanks in advance!

=UPPER(IF(Company="Grigeo Grigiškės";"GRI";"")&IF(Company="Grigeo Baltwood";"BWO";"")&IF(Company="Grigeo Klaipėdos Kartonas";"DAT";"")&IF(Company="Grigeo Recycling";"REC";"")&IF(Office="Office";"ADM";"")&IF(Office="Factory";"GAM";"")&(LEFT([Name];1)&LEFT([Surname];5)))

Since there is no REPLACE function in SharePoint, the only way is to do something like this

=IF(
    ISNUMBER(
        FIND("à",[YourColumn])
    );
    REPLACE([YourColumn],FIND("à",[YourColumn]),1,"a"),
    [YourColumn]
)

At first you check if the string contains the character to avoid #VALUE! exception, then you replace it.

The formula above works for a single letter, you need to nest the functions to replace all characters.

It's a little tricky but it's possible. Good luck ;)

Note: if you aren't using english as regional settings, you have to replace commas with ";" in the formula.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM