+ Reply to Thread
Results 1 to 7 of 7

find value in a cell where cell contains text and value

  1. #1
    Registered User
    Join Date
    05-25-2018
    Location
    Queensland, Australia
    MS-Off Ver
    2016
    Posts
    9

    find value in a cell where cell contains text and value

    I would like to be able to separate data in a cell and pick the value where the text within the cell is matched.

    eg a cell contains "rov6.25afr4". whereby the rov and afr depict departments, and 6.25 and 4 are the hours worked in the respective departments.

    I want to be able to sum all the values in cells that have rov and afr which will give the total hours worked in each department.

    eg 3 cells contain:
    "rov6.25afr4"
    "afr4"
    "rov5"

    I want a result that gives rov 11.25 and afr 8

    Can anyone help?!!

  2. #2
    Forum Expert tim201110's Avatar
    Join Date
    10-23-2011
    Location
    Russia
    MS-Off Ver
    2016, 2019
    Posts
    2,357

    Re: find value in a cell where cell contains text and value

    i changed "." to ","
    =IFERROR(-LOOKUP(1,-MID(MID($A3,FIND(B$2,$A3)+LEN(B$2),5)&" ",MIN(FIND({0,1,2,3,4,5,6,7,8,9},MID($A3,FIND(B$2,$A3)+LEN(B$2),5)&1/17)),ROW($A$1:$A$5))),"")
    Attached Files Attached Files

  3. #3
    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,023

    Re: find value in a cell where cell contains text and value

    or...

    =IFERROR(-LOOKUP(1,-LEFT(TRIM(MID($A3,FIND(B$2,$A3)+3,255)),{1,2,3,4,5,6,7,8,9})),"")
    Attached Files Attached Files
    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

  4. #4
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,586

    Re: find value in a cell where cell contains text and value

    A single UDF will give end result .Is it ok.
    Pl note
    Array formula should be confirmed with Ctrl+Shift+Enter keys together.
    If answere is satisfactory press * to add reputation.

  5. #5
    Registered User
    Join Date
    05-25-2018
    Location
    Queensland, Australia
    MS-Off Ver
    2016
    Posts
    9

    Re: find value in a cell where cell contains text and value

    Thanks Glenn - spot on!!

  6. #6
    Registered User
    Join Date
    05-25-2018
    Location
    Queensland, Australia
    MS-Off Ver
    2016
    Posts
    9

    Re: find value in a cell where cell contains text and value

    Hi Tim,

    Thanks.
    I need the "." to remain as is though.
    Glenn's solution is the one that worked for me.

  7. #7
    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,023

    Re: find value in a cell where cell contains text and value

    You're welcome.



    If that takes care of your original question, please select "Thread Tools" from the menu link above and mark this thread as SOLVED.

    It'd also be appreciated if you were to click the Add Reputation button at the foot of any of the posts of all members who helped you reach a solution.

+ 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. Find cell with text, offset to the left one cell and write code
    By timas in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 07-23-2015, 01:22 AM
  2. Replies: 3
    Last Post: 02-14-2014, 08:08 AM
  3. Macro to Find Matching text in a cell and select a specif cell
    By Carolynsdesk in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-20-2013, 07:28 AM
  4. [SOLVED] VBA Needed to find number/text within cell string and copy out to new cell
    By Campbell A in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 04-19-2013, 10:15 AM
  5. Replies: 0
    Last Post: 11-06-2012, 06:44 PM
  6. [SOLVED] Macro to find text and if found, copy an adjacent cell into a different cell
    By Raulus in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-22-2012, 09:57 AM
  7. [SOLVED] UDF code to find specific text in cell comments, then average cell values
    By bruch04 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-05-2005, 06:10 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