+ Reply to Thread
Results 1 to 12 of 12

Formula that picks up part of a sentence in a cell

  1. #1
    Registered User
    Join Date
    12-02-2012
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    51

    Formula that picks up part of a sentence in a cell

    Hi all,

    I wrote a formula that counts the number cells that contain “Yes” ($E$1 = Yes in the below formula). However sometimes the cell may contain more than just the word yes – for example ‘Yes – to be confirmed’ & my formula does not pick up this cell. Is there a way I can adjust the below formula to pick up the cell even if it has more than just the word in E1?

    =SUMPRODUCT((Sheet2!$F$5:$F$200= $C3)*(Sheet2!$B$5:$B$200= $E$1))

    Thanks

  2. #2
    Valued Forum Contributor
    Join Date
    02-08-2012
    Location
    Newcastle, Australia
    MS-Off Ver
    Excel 2007 and Excel 2010
    Posts
    1,429

    Re: Formula that picks up part of a sentence in a cell

    Sure,

    Change
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    to
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Let me know how this goes for you

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

    Re: Formula that picks up part of a sentence in a cell

    or maybe...
    =SUMPRODUCT((Sheet2!$F$5:$F$200= $C3)*(Sheet2!$B$5:$B$200= $E$1&"*"))
    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

  4. #4
    Registered User
    Join Date
    12-02-2012
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    51

    Re: Formula that picks up part of a sentence in a cell

    Thanks for your response AJ.

    Did i enter it in correctly? It returns the error #VALUE! when i plug it into excel.

    =SUMPRODUCT((Sheet2!$F$5:$F$200=$C3)*((MATCH(1,--(FIND($E$1,Sheet2!$B$5:$B$200)>0),0))))

  5. #5
    Registered User
    Join Date
    12-02-2012
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    51

    Re: Formula that picks up part of a sentence in a cell

    Thanks FDibbins - but that formula doesn't pick up the cells that just have YES, is there a way the formula could pick up both cells with just the word 'Yes' & cells that have say "Yes - to be confirmed'?

    Thanks guys

  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
    53,048

    Re: Formula that picks up part of a sentence in a cell

    Upload a sample workbook please

  7. #7
    Valued Forum Contributor
    Join Date
    02-08-2012
    Location
    Newcastle, Australia
    MS-Off Ver
    Excel 2007 and Excel 2010
    Posts
    1,429

    Re: Formula that picks up part of a sentence in a cell

    Hi Confused,

    Try the amended formula in my first post.

    I hope you have a bit more luck with that one

  8. #8
    Registered User
    Join Date
    12-02-2012
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    51

    Re: Formula that picks up part of a sentence in a cell

    Thanks guys - AJ your formula still returned #VALUE! =(

    Attached is an example of what im trying to do, see how my formula doesn't pick up the Yes value in cell B6 on sheet2.
    Attached Files Attached Files

  9. #9
    Forum Expert RobertMika's Avatar
    Join Date
    06-22-2009
    Location
    Haverhill, UK
    MS-Off Ver
    Excel 2003-13
    Posts
    1,530

    Re: Formula that picks up part of a sentence in a cell

    Are you using Excel 07?
    Then
    =COUNTIFS(Sheet2!$F$5:$F$200,$C3,Sheet2!$B$5:$B$200,E$1&"*")
    Down and accross
    If you are http://www.excelforum.com/image.php?type=sigpic&userid=125481&dateline=1392355029happy with the results, please add to the contributor's
    reputation by clicking the reputation icon (star icon).




    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved.
    To undo, select Thread Tools-> Mark thread as Unsolved.
    http://www.excelaris.co.uk

  10. #10
    Valued Forum Contributor
    Join Date
    02-08-2012
    Location
    Newcastle, Australia
    MS-Off Ver
    Excel 2007 and Excel 2010
    Posts
    1,429

    Re: Formula that picks up part of a sentence in a cell

    Ah yes I see!

    Try this then:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    the drag the formula across and down as far as is necessary.

    Hope this helps

  11. #11
    Registered User
    Join Date
    12-02-2012
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    51

    Re: Formula that picks up part of a sentence in a cell

    Guys - you have been fantastic, thank you!

  12. #12
    Valued Forum Contributor
    Join Date
    02-08-2012
    Location
    Newcastle, Australia
    MS-Off Ver
    Excel 2007 and Excel 2010
    Posts
    1,429

    Re: Formula that picks up part of a sentence in a cell

    No worries,

    Please don't forget to mark this thread as solved and click on the * nex to my post to say thanks

+ 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] Formula in one cell that picks up another based on dates provided in the same sheet
    By s.tara91 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-16-2013, 12:58 AM
  2. [SOLVED] Need a formula that picks up the date for Monday for each week from a given month and year
    By davisfs2007 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-11-2013, 02:21 PM
  3. Replies: 6
    Last Post: 11-11-2009, 09:00 AM
  4. Replies: 2
    Last Post: 07-17-2008, 08:37 AM
  5. [SOLVED] CELL that picks up or inserts text with formula
    By MikeR-Oz in forum Excel General
    Replies: 2
    Last Post: 02-26-2006, 06:45 AM

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