+ Reply to Thread
Results 1 to 11 of 11

Pick text from cell / remove text from cell

Hybrid View

  1. #1
    Registered User
    Join Date
    07-14-2019
    Location
    Milwaukee
    MS-Off Ver
    Professional Plus 2016
    Posts
    5

    Pick text from cell / remove text from cell

    I'm looking for a way to isolate the times from cells.
    This is START and END time, so I need the start time in one cell and the end time in another cell.
    My idea was to use the =RIGHT or =LEFT formula. The problem I have is that the Hours in the time are sometimes 1 digit (e.g. 9:02 PM) and sometimes 2 digits (e.g. 10:17 PM)

    Here's 3 examples of the raw data I have. I also have the option for my data to be without the parenthesis and its content, if that's makes it easier (e.g. 9:02 PM*to*9:48 PM)
    9:02 PM*to*9:48 PM*(for*an hour)
    9:44 PM*to*10:27 PM*(for*43 minutes)
    10:17 PM*to*10:28 PM*(for*11 minutes)

    The final goal I'm looking for is to have Start time / End Time / Duration in minutes. The duration should be able to handle if the start time is in PM and the end time is in AM (e.g. 11:50 PM to 12:10 AM)

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,969

    Re: Pick text from cell / remove text from cell

    I am not sure what is going on with all the *'s, and what is part of your cell content vs. commentary. I am going to assume your cell content looks like this:

    9:02 PM*to*9:48 PM

    Start time:
    Formula: copy to clipboard
    =TIMEVALUE(LEFT(A1,FIND("M",A1)))


    End Time:
    Formula: copy to clipboard
    =TIMEVALUE(MID(A1,FIND("to",A1)+3,8))


    Minutes (assuming the other two formulas are in columns B & C:
    Formula: copy to clipboard
    =(IF(C2<B2,1,0)+C2-B2)*24*60
    Jeff
    | | |·| |·| |·| |·| | |:| | |·| |·|
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    07-14-2019
    Location
    Milwaukee
    MS-Off Ver
    Professional Plus 2016
    Posts
    5

    Re: Pick text from cell / remove text from cell

    Hello 6StringJazzer

    Thanks so much for the reply. Sorry for the confusion, I don't know how those *s got there.
    Here's TWO examples of data that I have. My problem remains that I need to extract the start time and the end time from that data, and put them in 2 different cells. Can you advise, now that you have the correct format of my data? Thanks

    9:44 PM to 10:27 PM (for 43 minutes)
    10:17 PM to 10:28 PM (for 11 minutes)

  4. #4
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,969

    Re: Pick text from cell / remove text from cell

    The first formula is the same.

    The formula for end time is
    Formula: copy to clipboard
    =TIMEVALUE(MID(A1,FIND("to",A1)+3,FIND("(",A1)-(FIND("to",A1)+3)))

    There might be one that is more clever, but this works.

    The third formula is the same.

  5. #5
    Registered User
    Join Date
    07-14-2019
    Location
    Milwaukee
    MS-Off Ver
    Professional Plus 2016
    Posts
    5

    Re: Pick text from cell / remove text from cell

    Thanks again - clever or not clever it's better than nothing for me.
    I tried the formula though and it's not working. Please see screenshot:

    Capture.JPG
    Last edited by AliGW; 07-15-2019 at 04:47 PM. Reason: Edited for legibility

  6. #6
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,787

    Re: Pick text from cell / remove text from cell

    Does this make a difference?
    Formula: copy to clipboard
    =TIMEVALUE(SUBSTITUTE(MID(A1,FIND("to",A1)+3,FIND("(",A1)-(FIND("to",A1)+3)),CHAR(160)," "))

  7. #7
    Registered User
    Join Date
    07-14-2019
    Location
    Milwaukee
    MS-Off Ver
    Professional Plus 2016
    Posts
    5

    Re: Pick text from cell / remove text from cell

    Fluff13 YOU ARE INCREDIBLE !!!! I have no idea how that formula works, but it works perfectly. THANKS!!!!!

  8. #8
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,787

    Re: Pick text from cell / remove text from cell

    You're welcome & thanks for the feedback

    It's simply 6StringJazzer's formula with a SUBSTITUTE function added.
    I'm guessing that you copied the data from a web page, or some other outside source, and rather than having "normal" spaces it had "non breaking" spaces.
    The SUBSTITUTE "swaps" one for the other.

  9. #9
    Registered User
    Join Date
    07-14-2019
    Location
    Milwaukee
    MS-Off Ver
    Professional Plus 2016
    Posts
    5

    Re: Pick text from cell / remove text from cell

    Fluff13 ,yep... the data is from a time tracking CRM kind of website. For some reason it does't give you the per-user use report, so I have to put some manual work in it. At least is only copy/paste and the results are calculated by your formulas. THANKS AGAIN!

  10. #10
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,787

    Re: Pick text from cell / remove text from cell

    You're welcome

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

    Re: Pick text from cell / remove text from 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.
    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. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

+ 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] From Cell A2, remove text that is found in Cell B2, and display any remaining text in C2
    By lespaulfan#1 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 02-13-2019, 12:42 PM
  2. [SOLVED] Text to columns, pick text from a string in cell
    By soli004 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-30-2016, 07:55 PM
  3. Pick one out of several values in a text cell
    By Ilko in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-22-2016, 11:27 AM
  4. Replies: 3
    Last Post: 06-15-2014, 11:31 AM
  5. Text configuration – how can I tell a cell to pick up a phrase
    By Sarah Christian in forum Excel General
    Replies: 3
    Last Post: 08-15-2013, 10:40 PM
  6. [SOLVED] Remove Text+Numbers Sometimes, Based on Other Text in Cell
    By eugeniusjr in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-29-2013, 11:37 AM
  7. [SOLVED] Easiest way to remove text from a cell that has text and numbers?
    By cram.it.clownie@gmail.com in forum Excel General
    Replies: 2
    Last Post: 08-17-2006, 01:10 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