Not sure if this is possible.

  • Thread starter Thread starter Greg
  • Start date Start date
G

Greg

I have an excel document with credit card numbers and it is possible for me
to to only show the first 4 and last 4 numbers and mask what is between.

For example, my credit card number is :1111-2222222-3333 and I want to be
able to show 1111-XXXXXXX-3333. Is this possible?
 
Hi Greg,

Perhaps this will work for you.

=LEFT(M1,5)&M2&RIGHT(M1,5)

Where M1 has the credit card number in it.
Where M2 has xxxxxxx in it.

HTH
Regards,
Howard
 
Sadly, I think I have done something wrong. Am I understanding correctly?
For example, my cell my input was:

=LEFT(1111111111111111,5)&X&RIGHT(1111111111111111,5)
 
I think you have misunderstood Howards reply which will do what you wish.
Try this, put your example,

1111-XXXXXXX-3333

in A1, in B1 copy and paste this,

=LEFT(A1,4)&"XXXXXX"&RIGHT(A1,4)

Howards reply was using a seperate cell for XXXXXX

Regards,
Alan.
 
Okay I revised my formula as shown below.

=LEFT(M2,4)&"XXXXXXXX"&RIGHT(M2,4)

the result is 4500XXXXXXXX. Shouldn't I be able to see the last 4 digits
also?
 
Greg said:
my credit card number is :1111-2222222-3333 and I want
to be able to show 1111-XXXXXXX-3333.

=LEFT(A1,5) & REPT("X",LEN(A1)-10) & RIGHT(A1,5)


----- original message -----
 
Just to clarify - I realize you have a good solution from Tethless mama. But
if your full credit card number was in cell M2, then the formula
=LEFT(M2,4) & "xxxxxxxx" & Right(M2,4)
should have displayed "4500xxxxxxxx1234" assuming that M2 contained
4500-1234567-1234
But!! if the cell with the formula wasn't wide enough to show all of that
and there is something in the cell immediately to its right has something in
it, then some of the results could be hidden.
 
Back
Top