How can I search and replace parts of functions?

excelos

Well-known Member
Joined
Sep 25, 2011
Messages
592
Office Version
  1. 365
Platform
  1. Windows
Hello,
I want to search and replace the following:

=MAX(some-function,0)
with
=some-function

I tried to search for MAX( in order to delete it (and then I would delete the ,0) part but it does not work!
Any idea?
Thanks!
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
What value is the "some-function" ?
Are you sure you've spelt it correctly?

Maybe try searching for ",0)" instead?
 
Upvote 0
Hi,

Do a Find and Replace to change all "=" to e.g. "##" first, thus rendering your formulas as text, then carry out the two operations you give, and then finally replace all "##" back to "=", forcing Excel to once again consider them as formulas.

Note that any array formulas will need to be recommitted as such after carrying out this process.

Regards
 
Upvote 0
Assuming some-function is named and specified correctly, just select the cell or cells with the formula you want to modify, then call up Excel's Replace dialog box (CTRL+H), put everything after the equal sign in the "Find what" field, put what you want after the equal sign in the "Replace with" field, then click the "Options>>" button and make sure the "Look in" dropdown says "Formulas" and the "Match entire cell contents" checkbox is not checked, then click "Replace All".
 
Upvote 0
Assuming some-function is named and specified correctly, just select the cell or cells with the formula you want to modify, then call up Excel's Replace dialog box (CTRL+H), put everything after the equal sign in the "Find what" field, put what you want after the equal sign in the "Replace with" field, then click the "Options>>" button and make sure the "Look in" dropdown says "Formulas" and the "Match entire cell contents" checkbox is not checked, then click "Replace All".

I presume that some-function is not identical in all cells, but perhaps row- or column-relative, for example.

Regards
 
Upvote 0
I presume that some-function is not identical in all cells, but perhaps row- or column-relative, for example.

Regards

Hello,

As far as I understand, it's about replacing the MAX function in the formula and remaining just "some-function".

In this case it does not matter "some-function", because that part, will remain in the formula and the MAX function, can be replaced with the method proposed by Rick.
I often use this method and replacing (Ctrl-H) is done without errors.
 
Upvote 0
As far as I understand, it's about replacing the MAX function in the formula and remaining just "some-function".

In this case it does not matter "some-function", because that part, will remain in the formula and the MAX function, can be replaced with the method proposed by Rick.
I believe the point XOR LX was making is the "some-function" could have relative cell reference arguments and that if it did, Replace would not work or a range because the cell address on each line would be different from each other. What I suggested would work only for single cells or multiple cell ranges where "some-function" is a function that takes no arguments.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,178
Members
453,021
Latest member
Justyna P

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