Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
davids
 
Posts: n/a
Default replace numbers with X

I'm relatively new to Excel I'm wondering if there is a formula i can use
that replaces the last four numbers in a sequence with "X" no matter the
length of the sequence eg:

149876 14xxxx
1234789 123xxxx

This is not like the social security number where the amount of numbers is
fixed they are varying lengths. Thank you
  #2   Report Post  
Posted to microsoft.public.excel.misc
daddylonglegs
 
Posts: n/a
Default replace numbers with X


one way would be

=REPLACE(A1,LEN(A1)-3,4,"xxxx")


--
daddylonglegs
------------------------------------------------------------------------
daddylonglegs's Profile: http://www.excelforum.com/member.php...o&userid=30486
View this thread: http://www.excelforum.com/showthread...hreadid=522896

  #3   Report Post  
Posted to microsoft.public.excel.misc
davids
 
Posts: n/a
Default replace numbers with X

Apologies I need it to replace the first four digits with X
eg Account number = 123456 outcome I require is XXXX56

"daddylonglegs" wrote:


one way would be

=REPLACE(A1,LEN(A1)-3,4,"xxxx")


--
daddylonglegs
------------------------------------------------------------------------
daddylonglegs's Profile: http://www.excelforum.com/member.php...o&userid=30486
View this thread: http://www.excelforum.com/showthread...hreadid=522896


  #4   Report Post  
Posted to microsoft.public.excel.misc
daddylonglegs
 
Posts: n/a
Default replace numbers with X


Try

=REPLACE(A1,1,4,"xxxx")


--
daddylonglegs
------------------------------------------------------------------------
daddylonglegs's Profile: http://www.excelforum.com/member.php...o&userid=30486
View this thread: http://www.excelforum.com/showthread...hreadid=522896

  #5   Report Post  
Posted to microsoft.public.excel.misc
George
 
Posts: n/a
Default replace numbers with X

Just alter daddylonglegs formula

From =REPLACE(A1,LEN(A1)-3,4,"xxxx") Last 4
To =REPLACE(A1,1,4,"xxxx") First 4

George

davids wrote:
Apologies I need it to replace the first four digits with X
eg Account number = 123456 outcome I require is XXXX56

"daddylonglegs" wrote:


one way would be

=REPLACE(A1,LEN(A1)-3,4,"xxxx")


--
daddylonglegs
------------------------------------------------------------------------
daddylonglegs's Profile: http://www.excelforum.com/member.php...o&userid=30486
View this thread: http://www.excelforum.com/showthread...hreadid=522896




  #6   Report Post  
Posted to microsoft.public.excel.misc
bpeltzer
 
Posts: n/a
Default replace numbers with X

=left(trim(a1),len(a1)-4)&"xxxx"

"davids" wrote:

I'm relatively new to Excel I'm wondering if there is a formula i can use
that replaces the last four numbers in a sequence with "X" no matter the
length of the sequence eg:

149876 14xxxx
1234789 123xxxx

This is not like the social security number where the amount of numbers is
fixed they are varying lengths. Thank you

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to Replace Numbers with Phrases Jerry Arnone, PMP Excel Discussion (Misc queries) 1 June 29th 05 02:00 PM
How to Replace Numbers with Phrases Jerry Arnone, PMP Excel Discussion (Misc queries) 0 June 29th 05 12:37 PM
How do I sort letters before numbers in Excel? RiverGirl Excel Discussion (Misc queries) 4 May 27th 05 04:09 PM
Paste rows of numbers from Word into single Excel cell BecG Excel Discussion (Misc queries) 1 December 8th 04 04:55 PM
finding common numbers in large lists Jenn Excel Worksheet Functions 1 November 11th 04 07:42 PM


All times are GMT +1. The time now is 02:37 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"