If function: search for text in formula

nflami

New Member
Joined
Apr 16, 2014
Messages
25
Hello all,

I am trying to create a function that will search for text within the formula of a cell, currently I have only be able to search the values in cells.

=IF(ISNUMBER(MATCH("*"&"-"&"*",D3:AM3,0)),"Found","NotFound")

Above is the formula I'm using, but I need something similar where it can look at the formula. I'm trying to look to see if the formulas in a range contain a "minus sign (-)". Any ideas?

Thanks!
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
I think you will need VBA for that, here's a UDF:

Code:
Function FormulaMinus(r As Range) As String
Dim c As Range
Set c = r.Find("-", , xlFormulas)
FormulaMinus = IIf(c Is Nothing, "Not Found", "Found")
End Function
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,390
Messages
6,119,235
Members
448,879
Latest member
VanGirl

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