Search within a formula

Jon Peddie

New Member
Joined
Sep 4, 2020
Messages
5
Office Version
  1. 365
Platform
  1. Windows
I have an "IF" formula and I would like to search in it to see if it is pointing a specific cell. Is there any way to do that?
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
Welcome to the MrExcel board!

Perhaps I am not understanding what you actually want, but couldn't you just look at the formula to see?

Knowing what the IF formula actually is and what the 'specific cell' is might also help if you could post that information.
 
Upvote 0
Hi, and thanks
The formula in "this sheet," one of several in a workbook is: cell bb10=if(othersheet!bb10>0.001, othersheet!bb10,(ba10*BB11)) The logic is if there is a number in othersheet bb10, then use it, if it is empty then multiply the previous cell by a factor (bb11). The problem is when new data gets entered in othersheet, it doesn't sync with "this sheet." I can fix that by copying cell AZ and sweeping it across the row. But sometimes I forget to check (its a large a very large workbook and I get a lot of interruptions). I want to say (logically in bb9 "does bb10 contain othersheetbb10?" If the answer is "fail," then I will at least have an error warning. My ultimate goal is if the answer says fail, that kicks off a macro that then does the sweep operation (I've already built and named that macro). So my question is, is there a way to check a ("if") formula to determine if it has a specific variable? Thanks for any help you can render. Jon
 
Upvote 0
Assuming that you have Excel 2013 or later** try this in BB9
=IF(ISNUMBER(SEARCH("othersheet!BB10",FORMULATEXT(BB10))),"pass","fail")

** I suggest that you update your Account details (click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)


I'm wondering though that it might be simpler to run your macro anyway and have it check for the reference and either sweep or do nothing depending on the check result.
 
Upvote 0
Hot ****!! Thank you Peter SSs - that worked like a charm. I updated my account details, I'm using 365. This really helps me a lot, thanks again for taking the time. I'm a GPU expert, if you want to know anything about the latest ones, drop me a line (jon@jonpeddie.com) and/or visit my site (www.jonpeddie.com). Cheers
 
Upvote 0
Ut oh - if I drag the formula across the rows it doesn't increment - for example, BB stays BB all the way across.
 
Upvote 0
if I drag the formula across the rows it doesn't increment
Ah, you didn't say anything about dragging across. ;)

Try this instead.
=IF(ISNUMBER(SEARCH("othersheet!"&ADDRESS(ROW(BB10),COLUMN(),4),FORMULATEXT(BB10))),"pass","fail")
 
Upvote 0
You're welcome. Thanks for the follow-up. :)
 
Upvote 0

Forum statistics

Threads
1,213,543
Messages
6,114,237
Members
448,555
Latest member
RobertJones1986

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