+ Reply to Thread
Results 1 to 5 of 5

Extract a string using mid & find

  1. #1
    Registered User
    Join Date
    10-13-2015
    Location
    Auckland
    MS-Off Ver
    2013
    Posts
    12

    Extract a string using mid & find

    Hi,
    I need to extract the number of hours from a text string.
    The length varies. It can be 1 to 5 digits (eg. 6hrs or 30.36667hrs).
    I tried using mid and find, but need help with the length (file attached)
    Thanks
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor jtakw's Avatar
    Join Date
    05-05-2018
    Location
    CA, USA
    MS-Off Ver
    2016
    Posts
    668

    Re: Extract a string using mid & find

    Hi,

    Use this in I2 copied down:

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


    Results converted to Real numbers for further math/comparison, results Blank if No HRS values present, see attached.
    Attached Files Attached Files
    Last edited by jtakw; 10-04-2018 at 05:29 PM.

  3. #3
    Registered User
    Join Date
    10-13-2015
    Location
    Auckland
    MS-Off Ver
    2013
    Posts
    12

    Re: Extract a string using mid & find

    Thanks Jtakw,
    It works perfectly.

  4. #4
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2406 Win 11 Home 64 Bit
    Posts
    24,024

    Re: Extract a string using mid & find

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  5. #5
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2021
    Posts
    5,984

    Re: Extract a string using mid & find

    Or try:

    =-LOOKUP(1,-MID(H2,FIND("HRS",H2)-{1,2,3,4,5,6,7},{1,2,3,4,5,6,7}))

+ 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] extract multi-letter string bits from string depending on size and case
    By luv2glyd in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 02-18-2017, 10:41 PM
  2. [SOLVED] Search and Find - To extract some text from a string of text
    By Badvgood in forum Excel General
    Replies: 4
    Last Post: 11-01-2016, 01:04 PM
  3. [SOLVED] Extract all the words from a string for processing, while leaving string intact.
    By staggers47 in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 10-10-2014, 02:02 PM
  4. [SOLVED] Find and extract text string from within another text string
    By huy_le in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-12-2013, 03:22 PM
  5. Find and extract text string from within another text string
    By huy_le in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-09-2013, 09:01 PM
  6. [SOLVED] Extract a mainly numeric string (ISSN number) from an arbitrary string
    By Buzzed Aldrin in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 07-04-2012, 01:49 PM
  7. Find String in Range and Extract
    By janeset in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-23-2010, 01:13 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