+ Reply to Thread
Results 1 to 8 of 8

How to automatically remove part of the information in a returned cell

  1. #1
    Forum Contributor
    Join Date
    04-28-2016
    Location
    Stavanger, Norway
    MS-Off Ver
    365
    Posts
    142

    How to automatically remove part of the information in a returned cell

    I wish to automatically get my excel sheet to populate my A column with sample IDs copied into a different worksheet within the same excel project. I achieve this by simply adding =TRANSPOSE('Worksheet1'!C6:OS6) into column A in worksheet2 starting at A2. Sometimes the information taken from worksheet1 contains additional information that I wish to strip away. See example below;

    Example: In cell A2 I have "P1-1"
    What I copied into worksheet1: "P1-1"
    What I got in column A in worksheet2: "P1-1"
    What I would want to get in column A in worksheet2: "P1"

    Is there a formula to automatically strip away "-0" in this case? What comes after the dash may vary so it would be good to just get excel to remove the dash and everything after it.

    Please advice.
    Last edited by mss90; 10-02-2019 at 07:13 AM.

  2. #2
    Forum Expert PaulM100's Avatar
    Join Date
    10-09-2017
    Location
    UK
    MS-Off Ver
    Office 365
    Posts
    2,108

    Re: How to automatically remove part of the information in a returned cell

    Try: =LEFT(A2,FIND("-",A2)-1)
    Click the * to say thanks.

  3. #3
    Forum Expert José Augusto's Avatar
    Join Date
    10-29-2014
    Location
    Portugal
    MS-Off Ver
    2013-2016
    Posts
    3,329

    Re: How to automatically remove part of the information in a returned cell

    Hi

    Try
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  4. #4
    Forum Contributor
    Join Date
    04-28-2016
    Location
    Stavanger, Norway
    MS-Off Ver
    365
    Posts
    142

    Re: How to automatically remove part of the information in a returned cell

    It didnt work, please see revised question

  5. #5
    Forum Contributor
    Join Date
    04-28-2016
    Location
    Stavanger, Norway
    MS-Off Ver
    365
    Posts
    142

    Re: How to automatically remove part of the information in a returned cell

    It seems to work with this function
    Please Login or Register  to view this content.
    if I use it in a separate column. However, now it only copies over the ID if it contains "-" meaning, it copies P1-1 as P1 but if the ID happend to be just P1 it doesnt copy anything over. Is it possible to add an "IF" statement, staing something along the lines of; If it has -1, remove it BUT IF it doesnt then just copy as is?

    Please advice,

    Thanks

  6. #6
    Forum Expert PaulM100's Avatar
    Join Date
    10-09-2017
    Location
    UK
    MS-Off Ver
    Office 365
    Posts
    2,108

    Re: How to automatically remove part of the information in a returned cell

    Try: =IF(ISNUMBER(SEARCH("-";A2));LEFT(A2;FIND("-";A2;1)-1);A2)

  7. #7
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 V 2503
    Posts
    13,702

    Re: How to automatically remove part of the information in a returned cell

    Quote Originally Posted by mss90 View Post
    It didnt work, please see revised question
    Please do not back edit posts after people have responded. It "scrambles" the flow of conversation for those who join in later. Simply make corrections in a new post indicating what issue/post you are correcting.

    I am sure you understand. Thank you.

    Dave
    Dave

  8. #8
    Forum Contributor
    Join Date
    04-28-2016
    Location
    Stavanger, Norway
    MS-Off Ver
    365
    Posts
    142

    Re: How to automatically remove part of the information in a returned cell

    Quote Originally Posted by PaulM100 View Post
    Try: =IF(ISNUMBER(SEARCH("-";A2));LEFT(A2;FIND("-";A2;1)-1);A2)
    This worked, thank you!

+ 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] Saving MASTER file, automatically remove part of file name and append current date?
    By EnigmaMatter in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 09-10-2014, 08:13 AM
  2. [SOLVED] Take part information from a cell to creat a formular
    By Shannon561 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 07-03-2014, 11:18 AM
  3. [SOLVED] Remove part of pasted information in cells?
    By Vihral in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 12-19-2012, 12:57 PM
  4. [SOLVED] remove part of cell content
    By denvdm in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-01-2012, 05:05 AM
  5. Extract part of the information in a single cell?
    By Cidona in forum Excel - New Users/Basics
    Replies: 5
    Last Post: 11-20-2010, 04:18 AM
  6. Extrapolating information out of a cell Part 2
    By TommyB in forum Excel General
    Replies: 3
    Last Post: 12-15-2009, 08:32 PM
  7. Using returned values as part of another formula
    By Duby in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-01-2005, 11:05 AM

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