+ Reply to Thread
Results 1 to 11 of 11

Remove alphabets from number string in a cell

  1. #1
    Forum Contributor
    Join Date
    06-08-2021
    Location
    Toronto
    MS-Off Ver
    2016
    Posts
    101

    Remove alphabets from number string in a cell

    Hey guys,

    I am trying to remove alphabets that are mostly attached at the end of sets of numbers in my workbook. I've attached a sample file that shows what I currently have and what I am trying to achieve. Some numbers can be 10 digits long and some can be less than 10 digits long, both will have a letter attached to them at the end. I tried just removing the last value but there are cells with just numbers and that logic did not quite work for me.

    Any help is appreciated

    thanks in advance

    VJ
    Attached Files Attached Files

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2404 Win 11 Home 64 Bit
    Posts
    23,870

    Re: Remove alphabets from number string in a cell

    Can be achieved with Power Query called Get and Transform Data in your version of excel and found on the Data Tab

    Please Login or Register  to view this content.
    Power Query is a free AddIn for Excel 2010 and 2013, and is built-in functionality from Excel 2016 onwards (where it is referred to as "Get & Transform Data").

    It is a powerful yet simple way of getting, changing and using data from a broad variety of sources, creating steps which may be easily repeated and refreshed. I strongly recommend learning how to use Power Query - it's among the most powerful functionalities of Excel.

    - Follow this link to learn how to install Power Query in Excel 2010 / 2013.

    - Follow this link for an introduction to Power Query functionality.

    - Follow this link for a video which demonstrates how to use Power Query code provided.
    Attached Files Attached Files
    Last edited by alansidman; 12-01-2021 at 04:12 PM.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,169

    Re: Remove alphabets from number string in a cell

    Try

    =LEFT(A2, MATCH(FALSE, ISNUMBER(MID(A2, ROW(INDIRECT("1:"&LEN(A2)+1)), 1) *1), 0) -1)

    enter with Ctrl+Shift+Enter
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  4. #4
    Forum Contributor
    Join Date
    06-08-2021
    Location
    Toronto
    MS-Off Ver
    2016
    Posts
    101

    Re: Remove alphabets from number string in a cell

    Thanks for your response Alan.

    I tried downloading the file that you've attached to see what you have done, but I am not able to. It redirects me to a page where it wants me to login but when I try, it says I may not have privilege to the link. Do you know why?

    VJ

  5. #5
    Forum Contributor
    Join Date
    06-08-2021
    Location
    Toronto
    MS-Off Ver
    2016
    Posts
    101

    Re: Remove alphabets from number string in a cell

    Hi John

    Thanks for the formula. It worked for the most part. I also have some cell values that are like "101-21" and the formula removes the numbers after the "-" giving an output "101". Is there a way to fix this?

    VJ

  6. #6
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,169

    Re: Remove alphabets from number string in a cell

    Try

    =IF(CODE(RIGHT(A2))>=65,LEFT(A2,LEN(A2)-1),A2)

    If this does not provide solution then please provide a better sample of your data.

  7. #7
    Forum Contributor
    Join Date
    06-08-2021
    Location
    Toronto
    MS-Off Ver
    2016
    Posts
    101

    Re: Remove alphabets from number string in a cell

    Quote Originally Posted by JohnTopley View Post
    Try

    =IF(CODE(RIGHT(A2))>=65,LEFT(A2,LEN(A2)-1),A2)

    If this does not provide solution then please provide a better sample of your data.
    I've attached the updated sample file with data similar to the actual data. Column A is the actual data and Column D is the result I want to achieve.

    I hope this sample data is clear as each cell represents the actual length of my original data.

    VJ
    Attached Files Attached Files

  8. #8
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2404 Win 11 Home 64 Bit
    Posts
    23,870

    Re: Remove alphabets from number string in a cell

    @VJ
    Don't understand your issue. The file I attached is not linked to any other site. Here it is again.
    Attached Files Attached Files

  9. #9
    Forum Contributor
    Join Date
    06-08-2021
    Location
    Toronto
    MS-Off Ver
    2016
    Posts
    101

    Re: Remove alphabets from number string in a cell

    Alan,

    It worked this time. I wasn't sure why I had that issue earlier downloading the file. Never had it before, but, I downloaded the file this time.

    Thanks for you help

    VJ

  10. #10
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,169

    Re: Remove alphabets from number string in a cell

    See attached.
    Attached Files Attached Files

  11. #11
    Forum Contributor
    Join Date
    06-08-2021
    Location
    Toronto
    MS-Off Ver
    2016
    Posts
    101

    Re: Remove alphabets from number string in a cell

    it worked. Thanks again John

    VJ

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Remove all special characters and numerics (other that Alphabets)
    By kjxavier in forum Excel General
    Replies: 2
    Last Post: 08-04-2014, 01:47 AM
  2. how to remove alphabets from an alphanumeric string?
    By pavithran.T in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-02-2014, 07:00 AM
  3. [SOLVED] How to Count number of alphabets X & Y in the Cell
    By rk250150 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-06-2013, 07:22 AM
  4. [SOLVED] Remove/delete numbers to keep only Alphabets
    By Karnik in forum Excel General
    Replies: 11
    Last Post: 11-11-2012, 08:03 PM
  5. [SOLVED] Remove first 4 Alphabets in a Cell (Need the rest of information)
    By eltonlaw in forum Excel General
    Replies: 3
    Last Post: 05-19-2012, 04:39 AM
  6. Replies: 5
    Last Post: 11-23-2011, 08:20 AM
  7. remove alphabets
    By john_prince in forum Excel General
    Replies: 14
    Last Post: 05-04-2010, 11:27 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1