How to quickly change a formula in cells throughout worksheet


Posted by Anne on July 10, 2001 8:48 AM

I need to change the criteria in a sumif formula used throughout a spreadsheet, but not in a spceific column or row. Is there a quick, easy way change the formula in all cells at once?

Posted by Eric on July 10, 2001 12:07 PM

reference another cell in the sumif statement

Instead of typing in the criterion like:
=sumif(a2:a10,">5") type in =sumif(a2:a10,$a$1) and put your criterion >.5 in a1. Then you can change just the criterion address and it will update all the formulas that use the $a$1 reference.
Hope that helps

Posted by Anne on July 10, 2001 2:24 PM

Re: reference another cell in the sumif statement

I will definately write the function like that next time, thank you. Is there a way to change the formula that already exists using a find and replace type of command? Or do I have to change each group seperatly?



Posted by Eric on July 11, 2001 12:25 PM

find and replace worked for me, but be careful!

I don't know how big/complicated your spreadsheet is, so I'm gonna recommend you copy the spreadsheet to a new workbook and try this there before you fiddle with your actual workbook.
Using the example from below, where the criterion was typed into the sumif statement as ">5", try opening up search and replace by going to Edit-->Replace (or hit Ctrl-h), type in (including the quotes) ">5", in the "find what" box, and (no quotes) $a$1 in the "replace with" box, then cross your fingers and hit the "replace all" button and see if it worked. You could probably also "replace all" with another criterion instead of a cell reference (e.g. replace with ">10" instead of $a$1) but then you wont get that nifty one cell control.
Hope that helps.