Partial result

Hello,


I'm attempting to create a way to review an account number from one cell, and have a different cell populate just the last four digits with X's for any other remaining characters. So account 1234567 would show XXX4567, where as account 123456789 would show XXXXX6789. Fairly new to complex formulas and not sure where to start with this.

Tags:

Best Answer

  • James Keuning
    James Keuning ✭✭✭✭✭
    edited 03/02/22 Answer ✓

    =RIGHT("XXXXXXXXXXXXXXXXXXXXXXX" + RIGHT(account@row, 4), LEN(account@row))

    This assumes max account length of 18 digits. If you have longer numbers, add more Xs!


    EDIT to add:

    This formula will end with a result that is the same length as the original account number. If you want to fix the length, replace the "LEN(account@row)" at the end with whatever length you want, eg 10.

Answers

  • James Keuning
    James Keuning ✭✭✭✭✭
    edited 03/02/22 Answer ✓

    =RIGHT("XXXXXXXXXXXXXXXXXXXXXXX" + RIGHT(account@row, 4), LEN(account@row))

    This assumes max account length of 18 digits. If you have longer numbers, add more Xs!


    EDIT to add:

    This formula will end with a result that is the same length as the original account number. If you want to fix the length, replace the "LEN(account@row)" at the end with whatever length you want, eg 10.

  • That worked like a charm! Thank you

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!