+ Reply to Thread
Results 1 to 6 of 6

Formula to Remove, or not remove, certain text from a cell.

  1. #1
    Registered User
    Join Date
    10-21-2022
    Location
    Indiana, America
    MS-Off Ver
    Microsoft 365
    Posts
    7

    Question Formula to Remove, or not remove, certain text from a cell.

    I'm working on a worksheet that helps to manage some tooling inventory at my work and ran into a problem, so I was hoping that you guys could help me out.

    I have a formula that automatically brings my attention to any tooling we have low inventory on, and I have another field that automatically populates and shows me the average usage of the piece of tooling from the last 3 months. However, if we have a design change pending on that piece of tooling we add a '-1' to the end of the shelf number.

    When there is a shelf number with a '-1' attached to it that is low on inventory, I can't see the average usage of the piece.

    So I have created a formula so that if I had a piece of tooling called 5B002-1, it automatically removes the -1 for me and the original shelf number will be displayed. (5B002)
    (Formula Used: =LEFT(J8, SEARCH("-", J8)-1) )

    However, if there is no -1 on the shelf number, this formula will result in a #VALUE result.

    Is there anyway I could add in a IF X DO Y sort of conditional into this formula?

    Basically 5B002 would result in 5B002, but 5B002-1 would get turned into 5B002.

    Sorry for the round-about explanation of the problem, but I would appreciate any help.

    Thank you,

    EDIT: I've added a sample workbook with the problem area highlighted in purple.
    Attached Files Attached Files
    Last edited by Jake_San; 11-03-2022 at 12:52 PM.

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

    Re: Formula to Remove, or not remove, certain text from a cell.

    There are instructions at the top of the page explaining how to attach your sample workbook. Screenshots are of little practical use as we cannot manipulate them.

    A good sample workbook has just 10-20 rows of representative data that has been desensitised. It also has expected results mocked up, worked examples where required, relevant cells highlighted and a few explanatory notes.
    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
    Registered User
    Join Date
    10-21-2022
    Location
    Indiana, America
    MS-Off Ver
    Microsoft 365
    Posts
    7

    Re: Formula to Remove, or not remove, certain text from a cell.

    I've added a sample workbook to the post.

    Thank you for the help,

  4. #4
    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,906

    Re: Formula to Remove, or not remove, certain text from a cell.

    Try this copied down:

    =IFERROR(LEFT(I18, SEARCH("-", I18)-1),I18)

  5. #5
    Registered User
    Join Date
    10-21-2022
    Location
    Indiana, America
    MS-Off Ver
    Microsoft 365
    Posts
    7

    Re: Formula to Remove, or not remove, certain text from a cell.

    Thank you for the help Ali, that solved my problem!

  6. #6
    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,906

    Re: Formula to Remove, or not remove, certain text from a cell.

    Glad to have helped.

    If you have not already done so, you may not be aware that you can thank those who have helped you by clicking the small star icon (* Add Reputation) located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of all those who offered help.

+ 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. Formula to remove part of text from cell
    By Davidpcl in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-08-2020, 02:40 PM
  2. UDF to remove text from cell formula
    By DesM in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 09-06-2017, 09:47 AM
  3. Looking for a simple formula to remove unnecessary text from a cell
    By MichaelMcDanielITI in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-22-2016, 05:38 PM
  4. [SOLVED] Revise formula to remove sapces from text in another cell
    By topaz99 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-01-2015, 01:30 PM
  5. to remove duplicate text within a cell using formula.
    By tell_arshad in forum Excel General
    Replies: 4
    Last Post: 03-10-2015, 04:38 AM
  6. [SOLVED] Formula to remove smaller text string in cell
    By LightingPop in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 07-13-2013, 12:13 AM
  7. Formula to remove text from a cell
    By Backroomgeeza in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 02-18-2013, 02: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