+ Reply to Thread
Results 1 to 5 of 5

Search and Extract Cell Info

Hybrid View

bmsra79 Search and Extract Cell Info 04-26-2010, 03:08 AM
DonkeyOte Re: Search and Extract Cell... 04-26-2010, 03:18 AM
bmsra79 Re: Search and Extract Cell... 04-26-2010, 03:31 AM
estige Re: Search and Extract Cell... 04-26-2010, 04:03 AM
bmsra79 Re: Search and Extract Cell... 04-26-2010, 06:06 AM
  1. #1
    Registered User
    Join Date
    04-26-2010
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    9

    Search and Extract Cell Info

    I have the following text populated in an Excel cell:
    Task 1 (3 hrs); Task 2 (4 hrs); Task 3 (1 hr)

    I need to calculate the sum of (3+4+1) = 8 hrs and populate this in another cell.

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Search and Extract Cell Info

    Based on your example:

    =IF(ISNUMBER(SEARCH(" hr",A1)),SUM(IF(MID(A1,ROW(A$3:INDEX(A:A,LEN(A1)-3)),3)=" hr",--SUBSTITUTE(MID(A1,ROW(A$3:INDEX(A:A,LEN(A1)-3))-2,3),"(",""))),"")
    confirmed with CTRL + SHIFT + ENTER

    assumes no individual hour value ever exceeds 99 and that the string pattern is as consistent as outlined.
    Last edited by DonkeyOte; 04-26-2010 at 03:29 AM. Reason: added $ around A3 in case being copied vertically

  3. #3
    Registered User
    Join Date
    04-26-2010
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: Search and Extract Cell Info

    I have several cells populated in similar fashion: Example
    Task 55 (8 hrs) --> Here it should extract 8
    Task 22 (1 hr); Task 23 (5 hrs); Task 24 (2 hrs) ---> Here it should take (1+5+2=8) automatically

    I need a way for this formula to automatically find the number of tasks in the cell and do the addition.

    DonkeyOte: The code is not working???

  4. #4
    Valued Forum Contributor
    Join Date
    10-06-2008
    Location
    Norway
    MS-Off Ver
    2010
    Posts
    365

    Re: Search and Extract Cell Info

    DonkeyOte's code workes fine with me.
    Did you confirm with CTRL + SHIFT + ENTER

  5. #5
    Registered User
    Join Date
    04-26-2010
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: Search and Extract Cell Info

    Great. THanks. It works !!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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