# Microsoft Office Application Help - Excel Help forum > Excel Formulas & Functions >  >  If a cell contains a certain text then put a specified text in another cell?

## theblade24

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?

----------


## NBVC

Try:

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

----------


## theblade24

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.

----------


## NBVC

Then:

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

----------


## theblade24

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.

----------


## Dav

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

Regards

Dav

----------


## NBVC

> 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",""))

----------


## theblade24

You guys are so awesome, thanks!!!!!!!

----------


## jmaher1

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!

----------


## NBVC

_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.

----------


## hutchinsonld

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.

----------


## NBVC

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.

----------


## animac

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?

----------


## animac

> =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?

----------


## mdonnett

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?

----------


## Mr.Fitz

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.

----------


## Mr.Fitz

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

----------


## in nomine noctis

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?

----------


## Fotis1991

Welcome to the forum.

Pls start your own thread as per forum rules.

----------


## pricepeeler

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,

----------


## Ankit_Kumar

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

----------


## protonLeah

Ankit_Kumar,
This thread is eight years old

----------


## gigglesxx

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.

 :Smilie:

----------


## protonLeah

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?*

----------

