+ Reply to Thread
Results 1 to 12 of 12

How to delete alphanumerical characters (including blanks) up to a key word in a cell

  1. #1
    Registered User
    Join Date
    04-03-2018
    Location
    Ratingen, Germany
    MS-Off Ver
    Office 2016
    Posts
    3

    How to delete alphanumerical characters (including blanks) up to a key word in a cell

    Hi there,
    I have imported a CSV file into an Excel sheet.
    Some cells in a column contain a long string of alphanumerics including a keyword somewhere in the string.

    I want to edit the cell contents to remove (delete) all alphanumerics (from the left-hand side in the cell) up to the selected keyword.

    Points to be considered:
    1. The number (count) of alphanumerics preceding the keyword may vary from cell to cell in the column
    2. If necessary, it is acceptable to use a different formula for different keywords in different cells of the column.

    For a better understanding to explain what I wish to execute, an Excel file showing "sample data" and manually changed "desired results" has been attached.

    Thanks for your help in advance.
    Regards
    starter99
    Attached Files Attached Files

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,847

    Re: How to delete alphanumerical characters (including blanks) up to a key word in a cell

    Try this:

    =TRIM(MID(B5,FIND("Mandat",B5),100))
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: How to delete alphanumerical characters (including blanks) up to a key word in a cell

    Hello and welcome to the forum.

    This, in B11, returns your manually entered desired results:

    =IFERROR(MID(B3,FIND("Mandat",B3),LEN(B3)),B3)

    Copy down.

  4. #4
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Cool Re: How to delete alphanumerical characters (including blanks) up to a key word in a cell

    why not use built-in feature (Ex2016) PowerQuery (Get&Transform) ?

    with your example
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    04-03-2018
    Location
    Ratingen, Germany
    MS-Off Ver
    Office 2016
    Posts
    3

    Unhappy Re: How to delete alphanumerical characters (including blanks) up to a key word in a cell

    Hallo AliGW, 63Falcondude & sandy666,
    Thanks a lot for your very fast response suggesting different solution alternatives.

    I tried the formulas
    =IFERROR(MID(B3,FIND("Mandat",B3),LEN(B3)),B3), suggested by 63Falcondude
    and
    =TRIM(MID(B5,FIND("Mandat",B5),100)), suggested by AliGW

    but I am getting Excel's fomula error message.
    I must be doing something very stupid but I can't seem to get to it what is it precisely?

    I have tried these formulas under Excel "Office 2010" and "Office 2016" packages separately.
    For example, under Excel 2016 the error message looks like:
    180403 Test-checking results.xlsx

    Adding Apostrophe to the formula as mentioned in the error message didn't help either.
    I have never encountered such formula typing errors. It must be something very simple but what is it?

    Any suggestions would be most welcome.
    Thanks and regards
    starter99
    Attached Images Attached Images

  6. #6
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Office 365
    Posts
    3,935

    Re: How to delete alphanumerical characters (including blanks) up to a key word in a cell

    Perhaps change "," with ";"
    If I helped, Don't forget to add reputation (click on the little star ★ at bottom of this post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)

  7. #7
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,847

    Re: How to delete alphanumerical characters (including blanks) up to a key word in a cell

    As has been mentioned, for your locale you need this:

    =TRIM(MID(B5;FIND("Mandat";B5);100))

  8. #8
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: How to delete alphanumerical characters (including blanks) up to a key word in a cell

    maybbe:
    =WENNFEHLER(TEIL(B3;FINDEN("Mandat";B3);LÄNGE(B3));B3)
    =GLÄTTEN(TEIL(B5;FINDEN("Mandat";B5);100))

  9. #9
    Registered User
    Join Date
    04-03-2018
    Location
    Ratingen, Germany
    MS-Off Ver
    Office 2016
    Posts
    3

    Smile Re: How to delete alphanumerical characters (including blanks) up to a key word in a cell

    Hallo AliGW, 63Falcondude & sandy666

    Yes, this time it worked in a jiffy.
    The difference was indeed using ";" instead of a "," and also the German equivalents of:
    FIND = FINDEN
    TRIM = GLÄTTEN
    IFERROR = WENNFEHLER etc.

    So both suggestions:
    =WENNFEHLER(TEIL(B3;FINDEN("Mandat";B3);LÄNGE(B3));B3)
    =GLÄTTEN(TEIL(B5;FINDEN("Mandat";B5);100))
    worked flawlessly.

    It should have occurred to me after getting suggestions in your first response itself that I am using the "Office 2010, Office 2016" packages localized for German-speaking countries.
    I am sorry to have caused you additional work with your second mail.

    Thanks a lot to all three of you for your quick and very effective help.
    Best regards
    starter99


    PS: I would like to mark the problem as "solved" for this thread. However, I not sure if I am authorized to do it and if yes, how to do it after all. ;-))

  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,204

    Re: How to delete alphanumerical characters (including blanks) up to a key word in a cell

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

  11. #11
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,847

    Re: How to delete alphanumerical characters (including blanks) up to a key word in a cell

    Kein Problem!

  12. #12
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: How to delete alphanumerical characters (including blanks) up to a key word in a cell

    You are welcome

+ 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. Sorting alphanumerical characters sequencially.
    By jlbello in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-22-2016, 05:01 PM
  2. Macro to delete all text and characters BUT numbers (including decimals) from excel
    By coolruler in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-23-2015, 01:20 AM
  3. Replies: 7
    Last Post: 07-25-2014, 08:21 AM
  4. Length of a cell with fixed characters including spaces
    By treboll in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 12-19-2013, 02:59 PM
  5. Excel 2007 : Sumproduct is including blanks
    By ahmedmido in forum Excel General
    Replies: 3
    Last Post: 11-16-2010, 03:08 PM
  6. Fill the end of each cell with blanks to reach X number of characters
    By Damned in forum Excel Programming / VBA / Macros
    Replies: 19
    Last Post: 09-18-2010, 09:16 PM
  7. Delete A Word That Exceeds X Number Of Characters
    By brazen234 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-31-2005, 12:40 PM

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