Is there a way to delete certain characters within cells in a list in Excel
up vote
0
down vote
favorite
I have a data source file that contains an alphanumeric name and a number that is in a text file with no formatting (as an example "Dbandit46,500,856" where Dbandit is a username and 46,500,856 is a numerical value).
The data in the source file has been created by a process that can not be edited to provide formatting that would allow the cell contents to be split using conventional excel formulae or processes (such as, convert to text).
The text file is produced each week and the number of results varies from week to week (as an example - there might be 46 usernames in week 1; 53 usernames in week 2; 17 usernames in week 3).
Question:
Is there a way to remove the username from the cell contents/value by running a "vlookup", or "if statement" or "filter" or similar?
I am able to produce a list of usernames that I could use as selection criteria in a formula, but have no clue as to how to apply such a decision in a formula to remove the specific portion of the cell contents!
The alternative is to manually remove the username from the value each week.
Thanks!
[Using Excel 2016]
microsoft-excel-2016
add a comment |
up vote
0
down vote
favorite
I have a data source file that contains an alphanumeric name and a number that is in a text file with no formatting (as an example "Dbandit46,500,856" where Dbandit is a username and 46,500,856 is a numerical value).
The data in the source file has been created by a process that can not be edited to provide formatting that would allow the cell contents to be split using conventional excel formulae or processes (such as, convert to text).
The text file is produced each week and the number of results varies from week to week (as an example - there might be 46 usernames in week 1; 53 usernames in week 2; 17 usernames in week 3).
Question:
Is there a way to remove the username from the cell contents/value by running a "vlookup", or "if statement" or "filter" or similar?
I am able to produce a list of usernames that I could use as selection criteria in a formula, but have no clue as to how to apply such a decision in a formula to remove the specific portion of the cell contents!
The alternative is to manually remove the username from the value each week.
Thanks!
[Using Excel 2016]
microsoft-excel-2016
This can be done with Power Query. Although, XL 2016 perpetual licence may not have that M function, because it has not been updated. See link or link for a few ideas
– teylyn
Nov 26 at 8:02
Thanks for your reply - I've had a look and while the concept appears quite beautiful, I can see no way that I can implement it to address my issue... I am NOT a mathematician or a programmer!!! My problem, I guess!!!
– Megastar
Nov 26 at 8:19
May I know how much is the maximum characters allowed for a username?
– p._phidot_
Nov 26 at 17:45
Hi p.phidot_ - the usernames are variable and at the user's discretion, and as I replied to fixer1234, the user names can also have numerics within, such as "Caro1" and "Scotty15". The current longest username is 20 characters (alphanumeric) and the shortest is 3 alphanumeric characters.
– Megastar
Nov 27 at 22:46
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I have a data source file that contains an alphanumeric name and a number that is in a text file with no formatting (as an example "Dbandit46,500,856" where Dbandit is a username and 46,500,856 is a numerical value).
The data in the source file has been created by a process that can not be edited to provide formatting that would allow the cell contents to be split using conventional excel formulae or processes (such as, convert to text).
The text file is produced each week and the number of results varies from week to week (as an example - there might be 46 usernames in week 1; 53 usernames in week 2; 17 usernames in week 3).
Question:
Is there a way to remove the username from the cell contents/value by running a "vlookup", or "if statement" or "filter" or similar?
I am able to produce a list of usernames that I could use as selection criteria in a formula, but have no clue as to how to apply such a decision in a formula to remove the specific portion of the cell contents!
The alternative is to manually remove the username from the value each week.
Thanks!
[Using Excel 2016]
microsoft-excel-2016
I have a data source file that contains an alphanumeric name and a number that is in a text file with no formatting (as an example "Dbandit46,500,856" where Dbandit is a username and 46,500,856 is a numerical value).
The data in the source file has been created by a process that can not be edited to provide formatting that would allow the cell contents to be split using conventional excel formulae or processes (such as, convert to text).
The text file is produced each week and the number of results varies from week to week (as an example - there might be 46 usernames in week 1; 53 usernames in week 2; 17 usernames in week 3).
Question:
Is there a way to remove the username from the cell contents/value by running a "vlookup", or "if statement" or "filter" or similar?
I am able to produce a list of usernames that I could use as selection criteria in a formula, but have no clue as to how to apply such a decision in a formula to remove the specific portion of the cell contents!
The alternative is to manually remove the username from the value each week.
Thanks!
[Using Excel 2016]
microsoft-excel-2016
microsoft-excel-2016
asked Nov 26 at 7:24
Megastar
111
111
This can be done with Power Query. Although, XL 2016 perpetual licence may not have that M function, because it has not been updated. See link or link for a few ideas
– teylyn
Nov 26 at 8:02
Thanks for your reply - I've had a look and while the concept appears quite beautiful, I can see no way that I can implement it to address my issue... I am NOT a mathematician or a programmer!!! My problem, I guess!!!
– Megastar
Nov 26 at 8:19
May I know how much is the maximum characters allowed for a username?
– p._phidot_
Nov 26 at 17:45
Hi p.phidot_ - the usernames are variable and at the user's discretion, and as I replied to fixer1234, the user names can also have numerics within, such as "Caro1" and "Scotty15". The current longest username is 20 characters (alphanumeric) and the shortest is 3 alphanumeric characters.
– Megastar
Nov 27 at 22:46
add a comment |
This can be done with Power Query. Although, XL 2016 perpetual licence may not have that M function, because it has not been updated. See link or link for a few ideas
– teylyn
Nov 26 at 8:02
Thanks for your reply - I've had a look and while the concept appears quite beautiful, I can see no way that I can implement it to address my issue... I am NOT a mathematician or a programmer!!! My problem, I guess!!!
– Megastar
Nov 26 at 8:19
May I know how much is the maximum characters allowed for a username?
– p._phidot_
Nov 26 at 17:45
Hi p.phidot_ - the usernames are variable and at the user's discretion, and as I replied to fixer1234, the user names can also have numerics within, such as "Caro1" and "Scotty15". The current longest username is 20 characters (alphanumeric) and the shortest is 3 alphanumeric characters.
– Megastar
Nov 27 at 22:46
This can be done with Power Query. Although, XL 2016 perpetual licence may not have that M function, because it has not been updated. See link or link for a few ideas
– teylyn
Nov 26 at 8:02
This can be done with Power Query. Although, XL 2016 perpetual licence may not have that M function, because it has not been updated. See link or link for a few ideas
– teylyn
Nov 26 at 8:02
Thanks for your reply - I've had a look and while the concept appears quite beautiful, I can see no way that I can implement it to address my issue... I am NOT a mathematician or a programmer!!! My problem, I guess!!!
– Megastar
Nov 26 at 8:19
Thanks for your reply - I've had a look and while the concept appears quite beautiful, I can see no way that I can implement it to address my issue... I am NOT a mathematician or a programmer!!! My problem, I guess!!!
– Megastar
Nov 26 at 8:19
May I know how much is the maximum characters allowed for a username?
– p._phidot_
Nov 26 at 17:45
May I know how much is the maximum characters allowed for a username?
– p._phidot_
Nov 26 at 17:45
Hi p.phidot_ - the usernames are variable and at the user's discretion, and as I replied to fixer1234, the user names can also have numerics within, such as "Caro1" and "Scotty15". The current longest username is 20 characters (alphanumeric) and the shortest is 3 alphanumeric characters.
– Megastar
Nov 27 at 22:46
Hi p.phidot_ - the usernames are variable and at the user's discretion, and as I replied to fixer1234, the user names can also have numerics within, such as "Caro1" and "Scotty15". The current longest username is 20 characters (alphanumeric) and the shortest is 3 alphanumeric characters.
– Megastar
Nov 27 at 22:46
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote

This solution is based on a simplified version of a common method for finding the first number in a string. The simplification strips out "error handling" that is typically included, because I'm assuming all of your values will always start with a name and end with a number string.
The formula in B1:
=MID(A1,MIN(FIND({0,1,2,3,4,5,6,7,8,9},A1)),LEN(A1))
This is an array formula. In the image you see it surrounded by braces (actually the right brace is chopped off in the image). Excel places those there as an indicator when you use Ctrl + Shift + Enter to confirm the formula instead of just the normal Enter. Note that I did this in LibreOffice Calc, which requires that the formula be entered as an array formula. In Excel, that may not be necessary.
The MID(A1,...,LEN(A1)) portion extracts the number by taking the portion of the string starting at the first number location to the end of the string. The LEN(A1) will be longer than the number, but Excel runs out of characters at the end of the string.
The MIN(FIND({0,1,2,3,4,5,6,7,8,9},A1)) portion in the middle is what finds the first number. FIND looks for all of the digits in the string, and MIN identifies the earliest location.
Thank you so much for your response fixer1234. You have pointed out an omission in my explanation, especially as my example of "dbandit" was an example that did NOT have digits in the username. There are other usernames in the data list such as "Caro1" and "Scotty15", so selecting the first number in a string would not work against those types of usernames.... I am sorry for that omission from my explanation.
– Megastar
Nov 27 at 22:44
@Megastar, nobody will be able to give you a solution unless the question clearly states the requirements. Please edit the question to give examples that cover the full range of requirements. Show each source string and what the result should be. Also, if the name can contain a number, there is no way for Excel to know what is a name and where the "number" starts, unless you have a complete list of the "names" to compare against. If that list includes both "Scotty" and "Scotty15", how do you know where the number starts if the first two digits of the number are "15"?
– fixer1234
Nov 27 at 23:06
Thanks, fixer1234, for your response - and yes, I agree that the question needs to clearly state the requirements. However, your response did actually answer my question, where you stated: > if the name can contain a number, there is no way for Excel to know what is a name and where the "number" starts... which has confirmed my concerns... the result will be that I will not be able to automate the data editing, but will have to perform a manual edit for each set of results. Once again, thank you for your time, and I consider that this topic is now closed.
– Megastar
Nov 29 at 3:47
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote

This solution is based on a simplified version of a common method for finding the first number in a string. The simplification strips out "error handling" that is typically included, because I'm assuming all of your values will always start with a name and end with a number string.
The formula in B1:
=MID(A1,MIN(FIND({0,1,2,3,4,5,6,7,8,9},A1)),LEN(A1))
This is an array formula. In the image you see it surrounded by braces (actually the right brace is chopped off in the image). Excel places those there as an indicator when you use Ctrl + Shift + Enter to confirm the formula instead of just the normal Enter. Note that I did this in LibreOffice Calc, which requires that the formula be entered as an array formula. In Excel, that may not be necessary.
The MID(A1,...,LEN(A1)) portion extracts the number by taking the portion of the string starting at the first number location to the end of the string. The LEN(A1) will be longer than the number, but Excel runs out of characters at the end of the string.
The MIN(FIND({0,1,2,3,4,5,6,7,8,9},A1)) portion in the middle is what finds the first number. FIND looks for all of the digits in the string, and MIN identifies the earliest location.
Thank you so much for your response fixer1234. You have pointed out an omission in my explanation, especially as my example of "dbandit" was an example that did NOT have digits in the username. There are other usernames in the data list such as "Caro1" and "Scotty15", so selecting the first number in a string would not work against those types of usernames.... I am sorry for that omission from my explanation.
– Megastar
Nov 27 at 22:44
@Megastar, nobody will be able to give you a solution unless the question clearly states the requirements. Please edit the question to give examples that cover the full range of requirements. Show each source string and what the result should be. Also, if the name can contain a number, there is no way for Excel to know what is a name and where the "number" starts, unless you have a complete list of the "names" to compare against. If that list includes both "Scotty" and "Scotty15", how do you know where the number starts if the first two digits of the number are "15"?
– fixer1234
Nov 27 at 23:06
Thanks, fixer1234, for your response - and yes, I agree that the question needs to clearly state the requirements. However, your response did actually answer my question, where you stated: > if the name can contain a number, there is no way for Excel to know what is a name and where the "number" starts... which has confirmed my concerns... the result will be that I will not be able to automate the data editing, but will have to perform a manual edit for each set of results. Once again, thank you for your time, and I consider that this topic is now closed.
– Megastar
Nov 29 at 3:47
add a comment |
up vote
0
down vote

This solution is based on a simplified version of a common method for finding the first number in a string. The simplification strips out "error handling" that is typically included, because I'm assuming all of your values will always start with a name and end with a number string.
The formula in B1:
=MID(A1,MIN(FIND({0,1,2,3,4,5,6,7,8,9},A1)),LEN(A1))
This is an array formula. In the image you see it surrounded by braces (actually the right brace is chopped off in the image). Excel places those there as an indicator when you use Ctrl + Shift + Enter to confirm the formula instead of just the normal Enter. Note that I did this in LibreOffice Calc, which requires that the formula be entered as an array formula. In Excel, that may not be necessary.
The MID(A1,...,LEN(A1)) portion extracts the number by taking the portion of the string starting at the first number location to the end of the string. The LEN(A1) will be longer than the number, but Excel runs out of characters at the end of the string.
The MIN(FIND({0,1,2,3,4,5,6,7,8,9},A1)) portion in the middle is what finds the first number. FIND looks for all of the digits in the string, and MIN identifies the earliest location.
Thank you so much for your response fixer1234. You have pointed out an omission in my explanation, especially as my example of "dbandit" was an example that did NOT have digits in the username. There are other usernames in the data list such as "Caro1" and "Scotty15", so selecting the first number in a string would not work against those types of usernames.... I am sorry for that omission from my explanation.
– Megastar
Nov 27 at 22:44
@Megastar, nobody will be able to give you a solution unless the question clearly states the requirements. Please edit the question to give examples that cover the full range of requirements. Show each source string and what the result should be. Also, if the name can contain a number, there is no way for Excel to know what is a name and where the "number" starts, unless you have a complete list of the "names" to compare against. If that list includes both "Scotty" and "Scotty15", how do you know where the number starts if the first two digits of the number are "15"?
– fixer1234
Nov 27 at 23:06
Thanks, fixer1234, for your response - and yes, I agree that the question needs to clearly state the requirements. However, your response did actually answer my question, where you stated: > if the name can contain a number, there is no way for Excel to know what is a name and where the "number" starts... which has confirmed my concerns... the result will be that I will not be able to automate the data editing, but will have to perform a manual edit for each set of results. Once again, thank you for your time, and I consider that this topic is now closed.
– Megastar
Nov 29 at 3:47
add a comment |
up vote
0
down vote
up vote
0
down vote

This solution is based on a simplified version of a common method for finding the first number in a string. The simplification strips out "error handling" that is typically included, because I'm assuming all of your values will always start with a name and end with a number string.
The formula in B1:
=MID(A1,MIN(FIND({0,1,2,3,4,5,6,7,8,9},A1)),LEN(A1))
This is an array formula. In the image you see it surrounded by braces (actually the right brace is chopped off in the image). Excel places those there as an indicator when you use Ctrl + Shift + Enter to confirm the formula instead of just the normal Enter. Note that I did this in LibreOffice Calc, which requires that the formula be entered as an array formula. In Excel, that may not be necessary.
The MID(A1,...,LEN(A1)) portion extracts the number by taking the portion of the string starting at the first number location to the end of the string. The LEN(A1) will be longer than the number, but Excel runs out of characters at the end of the string.
The MIN(FIND({0,1,2,3,4,5,6,7,8,9},A1)) portion in the middle is what finds the first number. FIND looks for all of the digits in the string, and MIN identifies the earliest location.

This solution is based on a simplified version of a common method for finding the first number in a string. The simplification strips out "error handling" that is typically included, because I'm assuming all of your values will always start with a name and end with a number string.
The formula in B1:
=MID(A1,MIN(FIND({0,1,2,3,4,5,6,7,8,9},A1)),LEN(A1))
This is an array formula. In the image you see it surrounded by braces (actually the right brace is chopped off in the image). Excel places those there as an indicator when you use Ctrl + Shift + Enter to confirm the formula instead of just the normal Enter. Note that I did this in LibreOffice Calc, which requires that the formula be entered as an array formula. In Excel, that may not be necessary.
The MID(A1,...,LEN(A1)) portion extracts the number by taking the portion of the string starting at the first number location to the end of the string. The LEN(A1) will be longer than the number, but Excel runs out of characters at the end of the string.
The MIN(FIND({0,1,2,3,4,5,6,7,8,9},A1)) portion in the middle is what finds the first number. FIND looks for all of the digits in the string, and MIN identifies the earliest location.
edited Nov 27 at 9:28
answered Nov 27 at 9:16
fixer1234
17.4k144281
17.4k144281
Thank you so much for your response fixer1234. You have pointed out an omission in my explanation, especially as my example of "dbandit" was an example that did NOT have digits in the username. There are other usernames in the data list such as "Caro1" and "Scotty15", so selecting the first number in a string would not work against those types of usernames.... I am sorry for that omission from my explanation.
– Megastar
Nov 27 at 22:44
@Megastar, nobody will be able to give you a solution unless the question clearly states the requirements. Please edit the question to give examples that cover the full range of requirements. Show each source string and what the result should be. Also, if the name can contain a number, there is no way for Excel to know what is a name and where the "number" starts, unless you have a complete list of the "names" to compare against. If that list includes both "Scotty" and "Scotty15", how do you know where the number starts if the first two digits of the number are "15"?
– fixer1234
Nov 27 at 23:06
Thanks, fixer1234, for your response - and yes, I agree that the question needs to clearly state the requirements. However, your response did actually answer my question, where you stated: > if the name can contain a number, there is no way for Excel to know what is a name and where the "number" starts... which has confirmed my concerns... the result will be that I will not be able to automate the data editing, but will have to perform a manual edit for each set of results. Once again, thank you for your time, and I consider that this topic is now closed.
– Megastar
Nov 29 at 3:47
add a comment |
Thank you so much for your response fixer1234. You have pointed out an omission in my explanation, especially as my example of "dbandit" was an example that did NOT have digits in the username. There are other usernames in the data list such as "Caro1" and "Scotty15", so selecting the first number in a string would not work against those types of usernames.... I am sorry for that omission from my explanation.
– Megastar
Nov 27 at 22:44
@Megastar, nobody will be able to give you a solution unless the question clearly states the requirements. Please edit the question to give examples that cover the full range of requirements. Show each source string and what the result should be. Also, if the name can contain a number, there is no way for Excel to know what is a name and where the "number" starts, unless you have a complete list of the "names" to compare against. If that list includes both "Scotty" and "Scotty15", how do you know where the number starts if the first two digits of the number are "15"?
– fixer1234
Nov 27 at 23:06
Thanks, fixer1234, for your response - and yes, I agree that the question needs to clearly state the requirements. However, your response did actually answer my question, where you stated: > if the name can contain a number, there is no way for Excel to know what is a name and where the "number" starts... which has confirmed my concerns... the result will be that I will not be able to automate the data editing, but will have to perform a manual edit for each set of results. Once again, thank you for your time, and I consider that this topic is now closed.
– Megastar
Nov 29 at 3:47
Thank you so much for your response fixer1234. You have pointed out an omission in my explanation, especially as my example of "dbandit" was an example that did NOT have digits in the username. There are other usernames in the data list such as "Caro1" and "Scotty15", so selecting the first number in a string would not work against those types of usernames.... I am sorry for that omission from my explanation.
– Megastar
Nov 27 at 22:44
Thank you so much for your response fixer1234. You have pointed out an omission in my explanation, especially as my example of "dbandit" was an example that did NOT have digits in the username. There are other usernames in the data list such as "Caro1" and "Scotty15", so selecting the first number in a string would not work against those types of usernames.... I am sorry for that omission from my explanation.
– Megastar
Nov 27 at 22:44
@Megastar, nobody will be able to give you a solution unless the question clearly states the requirements. Please edit the question to give examples that cover the full range of requirements. Show each source string and what the result should be. Also, if the name can contain a number, there is no way for Excel to know what is a name and where the "number" starts, unless you have a complete list of the "names" to compare against. If that list includes both "Scotty" and "Scotty15", how do you know where the number starts if the first two digits of the number are "15"?
– fixer1234
Nov 27 at 23:06
@Megastar, nobody will be able to give you a solution unless the question clearly states the requirements. Please edit the question to give examples that cover the full range of requirements. Show each source string and what the result should be. Also, if the name can contain a number, there is no way for Excel to know what is a name and where the "number" starts, unless you have a complete list of the "names" to compare against. If that list includes both "Scotty" and "Scotty15", how do you know where the number starts if the first two digits of the number are "15"?
– fixer1234
Nov 27 at 23:06
Thanks, fixer1234, for your response - and yes, I agree that the question needs to clearly state the requirements. However, your response did actually answer my question, where you stated: > if the name can contain a number, there is no way for Excel to know what is a name and where the "number" starts... which has confirmed my concerns... the result will be that I will not be able to automate the data editing, but will have to perform a manual edit for each set of results. Once again, thank you for your time, and I consider that this topic is now closed.
– Megastar
Nov 29 at 3:47
Thanks, fixer1234, for your response - and yes, I agree that the question needs to clearly state the requirements. However, your response did actually answer my question, where you stated: > if the name can contain a number, there is no way for Excel to know what is a name and where the "number" starts... which has confirmed my concerns... the result will be that I will not be able to automate the data editing, but will have to perform a manual edit for each set of results. Once again, thank you for your time, and I consider that this topic is now closed.
– Megastar
Nov 29 at 3:47
add a comment |
Thanks for contributing an answer to Super User!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1378385%2fis-there-a-way-to-delete-certain-characters-within-cells-in-a-list-in-excel%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
This can be done with Power Query. Although, XL 2016 perpetual licence may not have that M function, because it has not been updated. See link or link for a few ideas
– teylyn
Nov 26 at 8:02
Thanks for your reply - I've had a look and while the concept appears quite beautiful, I can see no way that I can implement it to address my issue... I am NOT a mathematician or a programmer!!! My problem, I guess!!!
– Megastar
Nov 26 at 8:19
May I know how much is the maximum characters allowed for a username?
– p._phidot_
Nov 26 at 17:45
Hi p.phidot_ - the usernames are variable and at the user's discretion, and as I replied to fixer1234, the user names can also have numerics within, such as "Caro1" and "Scotty15". The current longest username is 20 characters (alphanumeric) and the shortest is 3 alphanumeric characters.
– Megastar
Nov 27 at 22:46