Forum Discussion

Ntnk1999's avatar
Ntnk1999
Copper Contributor
Jun 30, 2022

How to Masking the Name

 

 

Please help me. 

4 Replies

  • Ntnk1999 

    If you have the good fortune to be a 365 user, then the formula can be packaged somewhat differently.

    Worksheet formula
    = MAP(name, Maskλ)
    
    Maskλ 
    = LAMBDA(n,
         CONCAT(
            LET(
                k, SEQUENCE(LEN(n) - 4), 
                IF(MID(n, k, 1) <> " ", "*", " ")),
            LOWER(RIGHT(n,4))
         )
      )

    where 'name' is the array of names to be masked, and 'Maskλ' is a Lambda function that replaces non-space characters by "*".

    If the function is to be used in a Table then rather than a mapped array one would use

    = Maskλ(Table1[@Name])

    • Ntnk1999's avatar
      Ntnk1999
      Copper Contributor

      Riny_van_Eekelen

      Thank you for your response.

      Alex Richards*****ards*********ards**** ****ards
      Alexis Rose*****rose*******rose****** rose
      Samantha James*****ames**********ames******** *ames
      Guiseppa De Santosh   

       

      ******** ** ***tosh
      i want this time of format.

      please help me with the last entry 

      • Riny_van_Eekelen's avatar
        Riny_van_Eekelen
        Platinum Contributor

        Ntnk1999Probably a terrible formula if you don't have MS365 or Excel 2021. But if you are on either of these or Excel on-line, try this one:

        =TEXTJOIN("",,IF(MID(A1,SEQUENCE(LEN(A1)-4),1)=" ", " ","*"))&LOWER(RIGHT(A1,4))

         

         

Resources