return cell value if it contains X

erenkey

Board Regular
Joined
Dec 9, 2005
Messages
162
I need help with a formula that will retuen me a cell's contents if the cell contains the word TICKET.
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
Not sure what your cell references are. A formula like this can do it.
=IF(B3="TICKET",C3,"")

It just says if cell B3=ticket then return contents of C3, otherwise return a blank. You can change the cell references to what you need.
 
Upvote 0
Try:

=IF(ISNUMBER(SEARCH("Ticket",A1)),A1,"")
 
Upvote 0
Here's a start, return j and loop as required.

Code:
Sub find_cell_value()
Dim j

    Cells.Find("ticket", , xlValues, xlPart).Select
    j = ActiveCell.Value
    MsgBox (j)
End Sub
 
Upvote 0
The cell wil contain more info other than the word TICKET and the info is text and not numbres. Will this still work?
 
Upvote 0
Did you try what I posted above?

<b>Excel 2003</b><table cellpadding="2.5px" rules="all" style=";background-color: #FFFFFF;border: 1px solid;border-collapse: collapse; border-color: #A6AAB6"><colgroup><col width="25px" style="background-color: #E0E0F0" /><col /><col /></colgroup><thead><tr style=" background-color: #E0E0F0;text-align: center;color: #161120"><th></th><th>A</th><th>B</th></tr></thead><tbody><tr ><td style="color: #161120;text-align: center;">1</td><td style=";">dafd ticket dsajdksa</td><td style=";">dafd ticket dsajdksa</td></tr><tr ><td style="color: #161120;text-align: center;">2</td><td style=";">ticket sdajkf</td><td style=";">ticket sdajkf</td></tr><tr ><td style="color: #161120;text-align: center;">3</td><td style=";">deajdkafj;da ticket dsajkdfa</td><td style=";">deajdkafj;da ticket dsajkdfa</td></tr><tr ><td style="color: #161120;text-align: center;">4</td><td style=";">fjdaskl;fd</td><td style=";"></td></tr><tr ><td style="color: #161120;text-align: center;">5</td><td style=";">tdjsak;dfaticketdfsajk</td><td style=";">tdjsak;dfaticketdfsajk</td></tr></tbody></table><table cellpadding="2.5px" rules="all" style=";background-color: #FFFFFF;border: 1px solid;border-collapse: collapse; border-color: #A6AAB6"><thead><tr style="background-color: #E0E0F0;text-align: center;color: #161120"><th><b>Sheet1</b></th></tr></td></thead></table><br /><br /><table width="85%" cellpadding="2.5px" rules="all" style=";border: 2px solid black;border-collapse:collapse;padding: 0.4em;background-color: #FFFFFF" ><tr><td style="padding:6px" ><b>Worksheet Formulas</b><table cellpadding="2.5px" width="100%" rules="all" style="border: 1px solid;text-align:center;background-color: #FFFFFF;border-collapse: collapse; border-color: #A6AAB6"><thead><tr style=" background-color: #E0E0F0;color: #161120"><th width="10px">Cell</th><th style="text-align:left;padding-left:5px;">Formula</th></tr></thead><tbody><tr><th width="10px" style=" background-color: #E0E0F0;color: #161120">B1</th><td style="text-align:left">=IF(<font color="Blue">ISNUMBER(<font color="Red">SEARCH(<font color="Green">"Ticket",A1</font>)</font>),A1,""</font>)</td></tr></tbody></table></td></tr></table><br />
 
Upvote 0
Mine won't, but MR. Kowz will. If you dont want to return the same cell contents, you can modify Mr. Kowz to this:
=IF(ISNUMBER(SEARCH("ticket",A1,1)),C1,"")

This will return no matter where "ticket" is found in a text string.
 
Upvote 0

Forum statistics

Threads
1,224,602
Messages
6,179,844
Members
452,948
Latest member
UsmanAli786

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top