+ Reply to Thread
Results 1 to 9 of 9

Formula to insert text if text condition is met

  1. #1
    Registered User
    Join Date
    07-24-2012
    Location
    Orange county
    MS-Off Ver
    Excel 2007
    Posts
    10

    Formula to insert text if text condition is met

    I'm working with data for a website backend and knowing how to formulate this way help me tremendously.

    Essentially I would like to know how to create a formula that inserts desired text into a blank cell when certain texts are present from another.
    For example, if a certain text is present in A1, then insert desired text in b1.

    Seems simple enough, but I've been scratching my head for the last hour. A Google search has shown me the method, but only when numerical criteria is met.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Formula to insert text if text condition is met

    Hello koshersalt ,

    Welcome to the Forum!

    Providing actual examples, both before and after, will help you get a solution that works. If you can post your workbook then that would be even better.

    To Attach a File:

    1. Click on Go Advanced
    2. In the frame Attach Files you will see the button Manage Attachments
    3. Click the button.
    4. A new window will open titled Manage Attachments - Excel Forum.
    5. Click the Browse... button to locate your file for uploading.
    6. This will open a new window File Upload.
    7. Once you have located the file to upload click the Open button. This window will close.
    8. You are now back in the Manage Attachments - Excel Forum window.
    9. Click the Upload button and wait until the file has uploaded.
    10. Close the window and then click Submit.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Formula to insert text if text condition is met

    Please Login or Register  to view this content.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  4. #4
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Formula to insert text if text condition is met

    in B1
    =IF(A1="some text","desired text","")
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  5. #5
    Registered User
    Join Date
    07-24-2012
    Location
    Orange county
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: Formula to insert text if text condition is met

    Well the nature of sheet makes me hesitant to post, as it's a pricing guide.
    Maybe I can explain a little better with before and after.
    Before:
    A1 = "Black, red, yellow"; B1= blank
    After, if true:
    B2 = "Black"
    After, if false:
    B2 = blank

    I would like to know how to create a formula that would insert a desired string of text if there are desired texts in designated cells.

    Please let me know if I am not being clear enough.

  6. #6
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Formula to insert text if text condition is met

    still not clear to me-what does B2 depend on? if it's only A1 then
    =IF(ISNUMBER(SEARCH("black",A1)),"Black","")

  7. #7
    Registered User
    Join Date
    07-24-2012
    Location
    Orange county
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: Formula to insert text if text condition is met

    B2 would depend on if A1 had black in it's text. For example, if A1 had "Red, Black, Yellow", then I would like the formula to insert "Black" into B2.

    ---------- Post added at 03:30 PM ---------- Previous post was at 03:20 PM ----------

    Thanks JosephP, worked like a charm!

  8. #8
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Formula to insert text if text condition is met

    @ koshersalt

    Based on your last post it seems that you are satisfied with the solution(s) you've received but you haven't marked your thread as SOLVED. I'll do that for you now but please keep in mind for your future threads that Rule #9 requires you to do that yourself. If your problem has not been solved you can use Thread Tools (located above your first post) and choose "Mark this thread as unsolved".
    Thanks.

    Also, as a new member of the forum, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

  9. #9
    Registered User
    Join Date
    07-24-2012
    Location
    Orange county
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: Formula to insert text if text condition is met

    Cutter:
    Sorry, will do next time, thanks for changing the post status for me!
    Thanks have been sent!

+ 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