+ Reply to Thread
Results 1 to 24 of 24

If a cell contains a certain text then put a specified text in another cell?

  1. #1
    Registered User
    Join Date
    10-09-2006
    Posts
    36

    If a cell contains a certain text then put a specified text in another cell?

    I’m looking for a formula so that if it finds a certain specified text in say cell A2, then in cell D2 enter a different also specified text.

    So if cell A2 contains "16x20" then dump “Baseball,BaseballPhotos16x20” in cell D2. If it doesn’t contain 16x20, then don’t do anything.

    Help please?
    Last edited by NBVC; 05-06-2011 at 10:17 AM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Try:

    =IF(A2="16x20","Baseball,BaseballPhotos16x20","")
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    10-09-2006
    Posts
    36
    Minor problem....

    cell contains 16x20, not equals

    "16x20 photograph" would be the cell contents.... so it would look and see if 16x20 was somewhere in the A2 cell text and THEN return the data in the other cell if it found it, otherwise do nothing.

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Then:

    =IF(ISNUMBER(SEARCH("16x20",A2)),"Baseball,BaseballPhotos16x20","")

  5. #5
    Registered User
    Join Date
    10-09-2006
    Posts
    36
    Perfect!!

    Ok, now.....

    I'd like it to do multiple things... if it finds 16x20 return Baseball,BaseballPhotos16x20, if it finds 8x10 return Baseball,BaseballPhotos8x10 if it doesnt find either then do nothing.

  6. #6
    Forum Expert
    Join Date
    09-09-2005
    Location
    England
    MS-Off Ver
    2007
    Posts
    1,500
    =IF(ISNUMBER(SEARCH("16x20",A2)),"Baseball,BaseballPhotos16x20" ,IF(ISNUMBER(SEARCH("8x10",A2)),"Baseball,BaseballPhotos8x10",""))

    Regards

    Dav

  7. #7
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Perfect!!

    Ok, now.....

    I'd like it to do multiple things... if it finds 16x20 return Baseball,BaseballPhotos16x20, if it finds 8x10 return Baseball,BaseballPhotos8x10 if it doesnt find either then do nothing.
    =IF(ISNUMBER(SEARCH("16x20",A2)), "Baseball,BaseballPhotos16x20", IF(ISNUMBER(SEARCH("8x10",A2)),"Baseball,Basebal lPhotos8x10",""))

  8. #8
    Registered User
    Join Date
    10-09-2006
    Posts
    36
    You guys are so awesome, thanks!!!!!!!

  9. #9
    Registered User
    Join Date
    05-04-2011
    Location
    South Bend, IN
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: If a cell contains a certain text then put a specified text in another cell?

    Can you guys help me out? I want to add a space, the word and, and another space to the beginning of a cell if it contains any text. so if the cell says "john" I want to change it to " and John" and if it is blank then leave it blank. thank you so much!

  10. #10
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: If a cell contains a certain text then put a specified text in another cell?

    Your post does not comply with Rule 2 of our Forum RULES. Don't post a question in the thread of another member -- start your own thread. If you feel it's particularly relevant, provide a link to the other thread.

  11. #11
    Registered User
    Join Date
    09-28-2011
    Location
    Richmond, VA
    MS-Off Ver
    Excel 2011
    Posts
    2

    Re: If a cell contains a certain text then put a specified info in another cell?

    I basically am using this formula: =IF('Job Reports'!E14="abcd","0000-00-000",""). This allows for when one option in a drop down box is selected for another cell to display 0000-00-000. However I would like it to display a different set of numbers if another option from the drop down box is selected. So if the option in the drop down box were abcd, bbbb, cccc, dddd, and abcd was selected if would display 0000-00-000 or if bbbb was selected it would display 1111-11-111 or if cccc was selected it would display 2222-22-222 or if dddd was selected it would display 3333-33-333. I want this function to happen all in one cell.

  12. #12
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: If a cell contains a certain text then put a specified text in another cell?

    Welcome to the forum,

    Your post does not comply with Rule 2 of our Forum RULES. Don't post a question in the thread of another member -- start your own thread. If you feel it's particularly relevant, provide a link to the other thread.

  13. #13
    Registered User
    Join Date
    10-11-2011
    Location
    Mexico
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: If a cell contains a certain text then put a specified text in another cell?

    Hi, You solve the separate cases. In one you look for "16x..." and in the other "18x...". Is it possible to have an especific result if the cell contains either "16x..." or "18x..." or both? For exemple, "16x..."--> text 1, "18x..."--> text 2, "16x..." or "18x..."--> text 3. Is it possible?

  14. #14
    Registered User
    Join Date
    10-11-2011
    Location
    Mexico
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: If a cell contains a certain text then put a specified text in another cell?

    Quote Originally Posted by NBVC View Post
    =IF(ISNUMBER(SEARCH("16x20",A2)), "Baseball,BaseballPhotos16x20", IF(ISNUMBER(SEARCH("8x10",A2)),"Baseball,Basebal lPhotos8x10",""))
    Hi, You solve the separate cases. In one you look for "16x..." and in the other "18x...". Is it possible to have an especific result if the cell contains either "16x..." or "18x..." or both? For exemple, "16x..."--> text 1, "18x..."--> text 2, "16x..." or "18x..."--> text 3. Is it possible?

  15. #15
    Registered User
    Join Date
    10-12-2011
    Location
    Vancouver, BC
    MS-Off Ver
    Excel 2003
    Posts
    1

    Re: If a cell contains a certain text then put a specified text in another cell?

    how do you start your own thread? I have a question, but don't know how to ask it!
    my question is:
    i want to create a chart to capture our invoices and how much has come in since the last check run (done semi-monthly)
    i would like to see the each period with a total that i have been tracking with incoming invoices on a different tab.

    which chart should i use? or is this a pivot table type of task?
    if i have been entering a date for every invoice, is there a chart that can "round up" to the nearest semi monthly point?

  16. #16
    Registered User
    Join Date
    06-21-2013
    Location
    Arizona
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: If a cell contains a certain text then put a specified text in another cell?

    So I am having trouble figuring out how to do multiple text to equal multiple numbers. For instance right now I use =IF(E9="JOHN DOE","07", but I would like to have it where IF E9 = John Doe the cell shows 07, but IF the E9 = Sam Doe I want the cell to show 08, and the same IF E9 = Pat Doe the cell shows 09 and so on. Is there a way to do this? Thanks for the help, I like the NBVC and everyone else have already posted.

  17. #17
    Registered User
    Join Date
    06-21-2013
    Location
    Arizona
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: If a cell contains a certain text then put a specified text in another cell?

    Sorry just realized I am not supposed to reply with a question to an existing post. Sorry brand new to this site :-(

  18. #18
    Registered User
    Join Date
    11-05-2013
    Location
    Europe
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: If a cell contains a certain text then put a specified text in another cell?

    Hi guys, newbie here.

    Looking for formula that, in row "Description" I have comments like this: "OPPOSITE TAB SIDE DISCHARGE REED AND BOOSTER FRACTURED" or "TAB SIDE DISCHARGE RETAINING BOLT/NUT ASSEMBLY LOOSE IN"
    This comments are always different, but always contains Opposite tab and/or Tab side

    I need a formula that will dump information type: Opposite tab or Tab side, but in case that that description doesn't contain any of them return "Not found"

    I have tried this one:
    =IF(ISNUMBER(SEARCH("OPPOSITE TAB";O2));"OPP SIDE";"TAB SIDE")

    Any idea?

  19. #19
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: If a cell contains a certain text then put a specified text in another cell?

    Welcome to the forum.

    Pls start your own thread as per forum rules.
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  20. #20
    Registered User
    Join Date
    02-22-2012
    Location
    Dallas, TX
    MS-Off Ver
    Excel 2007
    Posts
    13

    Re: If a cell contains a certain text then put a specified text in another cell?

    I started my own thread. I thought if it was a related question I could tag along, but then I read the rules.
    Thank you,
    Attached Files Attached Files
    Last edited by pricepeeler; 01-10-2014 at 05:05 PM.
    Thank you for the assistance!

  21. #21
    Registered User
    Join Date
    04-20-2015
    Location
    India
    MS-Off Ver
    2013
    Posts
    77

    Re: If a cell contains a certain text then put a specified text in another cell?

    Hi Everyone,

    This answer for those user who will come on this thread to know the multiple ways to solve this problem. Please try this formula:-

    =IFERROR(IF(SEARCH(“*tain*”,A2,1),”tain”),”No”)

    Thanks

  22. #22
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,598

    Re: If a cell contains a certain text then put a specified text in another cell?

    Ankit_Kumar,
    This thread is eight years old
    Ben Van Johnson

  23. #23
    Registered User
    Join Date
    02-14-2018
    Location
    Melbourne, Australia
    MS-Off Ver
    Microsoft Excel 2010
    Posts
    4

    Re: If a cell contains a certain text then put a specified text in another cell?

    Hi,

    I am looking for a formula which looks for a specific word in one column, and if it finds it, then it returns the word in the cell adjacent to it.

    For example if row 2 column A contains the word Australia, then return the text in row 2 column B.

    Any help would be much appreciated.


  24. #24
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,598

    Re: If a cell contains a certain text then put a specified text in another cell?

    gigglesxx,
    Unfortunately your post does not comply with Rule 2 of our Forum RULES. Do not post a question in the thread of another member -- start your own thread.

    If you feel an existing thread is particularly relevant to your need, provide a link to the other thread in your new thread.

    Old threads are often only monitored by the original participants. New threads not only open you up to all possible participants again, they typically get faster response, too.

    You agreed to the rules when you joined, no?

+ 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