+ Reply to Thread
Results 1 to 10 of 10

Need help with a formula that removes text.

  1. #1
    Registered User
    Join Date
    01-28-2019
    Location
    California, United States
    MS-Off Ver
    10
    Posts
    3

    Question Need help with a formula that removes text.

    Hey all!

    I just joined today and I'm in need with help for a formula. So what I am doing is that I am exporting my data and when I paste it.

    The column has all the following in it:

    01/25/2019 11:59 PM PST

    I was seeing if there is anyway someone can help with a formula that gets rid of the PST. I haven't gotten anywhere with it and can't find anything.

    Thank you!!

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,063

    Re: Need help with a formula that removes text.

    It depends on exactly what way the column is formatted. But, as a first step,

    =LEFT(A1,SEARCH("PST",A1)-1)+0

    and format as desired.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  3. #3
    Valued Forum Contributor
    Join Date
    10-29-2012
    Location
    Mojokerto,Indonesia
    MS-Off Ver
    Excel 2007
    Posts
    554

    Re: Need help with a formula that removes text.

    =substitute(a1,"pst",)

  4. #4
    Registered User
    Join Date
    01-28-2019
    Location
    California, United States
    MS-Off Ver
    10
    Posts
    3

    Re: Need help with a formula that removes text.

    The column when I paste it is General.

    I used that formula and I just get a string of text instead.

    Also the column does have spaces in it if that helps.
    Last edited by Casaray; 01-28-2019 at 01:31 AM.

  5. #5
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,063

    Re: Need help with a formula that removes text.

    Will you please attach a SMALL sample Excel workbook (10-20 rows of data is usually enough)? However, please give us an indication of the approximate number of rows of data you want the solution to work with (100, 1000, 100,000 or whatever). Please don't attach a picture of an Excel sheet (no-one will want to re-type all your stuff before starting).

    1. It does NOT have to be your real sheet - mock up a SAMPLE if you need to. But not 1000's of rows!!! It makes manual checking so tedious. Whatever you do... make sure that all confidential information is removed first!!

    2. Make sure that your sample data are truly REPRESENTATIVE of your real data. The use of unrepresentative data is very frustrating and can lead to long delays in reaching a solution.

    3. Make sure that your desired solution is also shown (mock up the results manually).

    4. Try to avoid using merged cells. They cause lots of problems!

    Unfortunately the attachment icon doesn't work at the moment. So, to attach an Excel file you have to do the following: Just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,939

    Re: Need help with a formula that removes text.

    Quote Originally Posted by Ghozi Alkatiri View Post
    =substitute(a1,"pst",)
    That will still return text, use -- (or +0) to convert...
    =--SUBSTITUTE(G23," PST",)

    Also note the addition of a leading space, and the use of CAPS
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  7. #7
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,939

    Re: Need help with a formula that removes text.

    Quote Originally Posted by Casaray View Post
    The column when I paste it is General.

    I used that formula and I just get a string of text instead.

    Also the column does have spaces in it if that helps.
    Oftentimes when converting text dates/times to real dates/times, excel will try and "help" by reformatting the cell as text. Try reformatting it to date

  8. #8
    Registered User
    Join Date
    01-28-2019
    Location
    California, United States
    MS-Off Ver
    10
    Posts
    3

    Re: Need help with a formula that removes text.

    Thank you! Reformatting it worked!

    Thank you all for the help. One last question to ask,

    It works but when I paste the data that I need, it removes the formula. Is there anyway to have that formula on another sheet to pull that information? The formula that I have can't pull data because of the PST, so I would only need the date/time.

  9. #9
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,570

    Re: Need help with a formula that removes text.

    If you are pasting the data to Sheet1 and pulling the date/time to Sheet2 you could try: =--SUBSTITUTE('Sheet1'!G23," PST",)
    Let us know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  10. #10
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Need help with a formula that removes text.

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

    v A B
    1 01/25/2019 11:59 PM PST 01/25/2019 11:59 PM
    Format as Custom, mm/dd/yyyy hh:mm AM/PM
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

+ 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] Change formula that removes blank cells to also exclude certain text from output list.
    By Big.Moe in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 07-26-2018, 03:50 PM
  2. Removes ALL spaces and commas from a text string
    By tccheung in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-12-2017, 10:51 PM
  3. Text box changes to "Yes" if someone removes formula?
    By domgilberto in forum Excel General
    Replies: 25
    Last Post: 05-12-2014, 11:14 AM
  4. Importing text file in excel using VBA that removes headers and spaces
    By chfinja in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-15-2014, 10:14 AM
  5. number-to-text conversion removes commas
    By wildcatherder in forum Excel General
    Replies: 3
    Last Post: 12-28-2010, 05:41 PM
  6. macro that exports text to notepad and also removes consecutive exclamation points...
    By indullg83 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-15-2009, 12:51 PM
  7. Macro Removes Formula
    By Althas in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-21-2008, 10:25 AM

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