I have a bunch of SUMIF statements that I need to fix.
Previously I was using this formula to ignore #NA errors:
=SUMIF([range],"<>#N/A",[range])
This no longer works in v7 because v7 no longer returns #N/A as the error I’m trying to ignore. It’s now Err:503. I suppose I could just change this to =SUMIF([range],"<>Err:503",[range])
but I’d like to use a matrix formula to filter errors more robustly, and to (hopefully) speed things up. It will also keep my documents compatible with both v6 and v7. With the help of this answer, I’ve identified this matrix formula as a more suitable replacement:
=SUM(IFERROR([range],""))
This works as long as I enter the replacement formula using Ctrl-Shift-Enter to tell Calc that the use of IFERROR should return a matrix.
So far so good. My problem is now with find & replace. I have hundreds of these formula spread across multiple sheets and documents. I’ve accepted that I have to update sheets individually, but I don’t want to go cell-by-cell. So, I’m using Find & Replace to update the formulas. These regexes correctly replace the old formula with the new one:
Find: ^=SUMIF\((.+),\"<>#N/A\".+
Replace: {=SUM(IFERROR($1,""))}
My understanding is that surrounding the formula with { } should tell calc to interpret the cell as a matrix formula (i.e. it should accomplish the same thing as entering the formula using Ctrl-Shift-Enter). However this doesn’t work. The cells contain the correct formula surrounded in curly braces, but are not recognized as a valid matrix formula.
How do I tell find & replace that the replacement is a matrix formula? Is that even possible?