+ Reply to Thread
Results 1 to 9 of 9

Simplify text from range of text options

Hybrid View

  1. #1
    Registered User
    Join Date
    09-13-2012
    Location
    Edinburgh, Scotland
    MS-Off Ver
    Excel 2010
    Posts
    3

    Simplify text from range of text options

    A cell contains either "Yes", "Yes +Comment", "No", "No + Comment", "Comment only", or "No response"
    I want to summarise these, so that the neighbouring cell will contain Yes, No, or No response ie.

    "Yes" or "Yes +Comment" = "Yes"
    "No" or "No + Comment" = "No"
    "Comment only" or "No response" = "No response".

    Help please, Linda
    Last edited by lindaroslin; 09-14-2012 at 01:02 AM.

  2. #2
    Registered User
    Join Date
    08-10-2012
    Location
    Rotterdam, Holland
    MS-Off Ver
    Excel 2010
    Posts
    31

    Re: Simplify text from range of text options

    Let's say cell A2 contains the yes or no or one of them with comment, then put in cell B2:
    Formula: copy to clipboard
    =IF(LEFT(A2;2)="No";"No";"Yes")


    This assumes only yes or no are the first word in the cell, no answers like maybe or don't know.

  3. #3
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,327

    Re: Simplify text from range of text options

    Hi Linda & Welcome to the Forum,

    You could build a lookup table and then use

    =VLOOKUP(lookup_value,table_array,col_index_num,range_lookup)
    =VLOOKUP(A1,H1:I6,2,0)

    column H is the comment and column I contains the response.

    A1 is the comment you are looking up
    Attached Files Attached Files
    Last edited by jeffreybrown; 09-13-2012 at 02:11 PM.
    HTH
    Regards, Jeff

  4. #4
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: Simplify text from range of text options

    Use..

    =IF(ISNUMBER(SEARCH("Yes",A1)),"yes",IF(OR(ISNUMBER(SEARCH("No response",A1)),NOT(ISNUMBER(SEARCH("No",A1))),"No response"),"No"))
    Life's a spreadsheet, Excel!
    Say thanks, Click *

  5. #5
    Registered User
    Join Date
    09-13-2012
    Location
    Edinburgh, Scotland
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Simplify text from range of text options

    Thanks for trying, but I'm sorry, that's not working - it only works for Yes and Yes + comment, not for No, No + Comment, Comment only or No response.
    Linda

  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,053

    Re: Simplify text from range of text options

    try this...
    =IF(LEFT(A6,3)="Yes","Yes",IF(LEFT(A6,2)="No","No",IF(OR(LEFT(A4,3)<>"Yes",LEFT(A4,2)<>"no",A4=""),"No response","")))
    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

  7. #7
    Registered User
    Join Date
    09-13-2012
    Location
    Edinburgh, Scotland
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Simplify text from range of text options

    Quote Originally Posted by FDibbins View Post
    try this...
    =IF(LEFT(A6,3)="Yes","Yes",IF(LEFT(A6,2)="No","No",IF(OR(LEFT(A4,3)<>"Yes",LEFT(A4,2)<>"no",A4=""),"No response","")))
    Solved
    Many thanks FDibbins , that works a treat when I substitute the same reference cell for A6 and A4.
    I'll now sit quietly and try to understand why it works.
    Linda

  8. #8
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,327

    Re: Simplify text from range of text options

    Glad to hear you have a workable solution Linda and thanks for the feedback

    A good way to break down a formula is by using evaluate formula

    Place cursor on the formula >> On the ribbon >> Formulas >> Formula Auditing >> Evaluate Formula

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.

    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save

  9. #9
    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,053

    Re: Simplify text from range of text options

    glad to help, when you mentioned A4, i saw that it was supposed to be A6, sorry about that, and good catch from your side.
    what its doing is testing the 1st 2 or 3 letters for yes or no...and then neither yes or no BUT also has No input. hope that helps?
    thx for the star, too

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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