I have a custom function in my sheet which returns the color code for the font color of an inputted cell. It has been working fine for a few months, but today, one out of 61 cells using the custom function return an error saying "Internal error executing custom formula". I do not understand why this problem would exist only in this cell (it is the 6th of 61 cells with the function) nor how to fix it. The custom function follows here:
function FontColor(input) {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheets()[0];
var cell = sheet.getRange(input);
var testColor = cell.getFontColor();
return testColor
}
(Apologies if I formatted the code wrong)
This is a relatively simple code and there have been no problems for months. Today, I added 7 new rows where this custom function was being used in one cell per row, and the error appeared back up near the top in row 6. The formula is being used as such:
In cell Q3
, the formula is =FontColor(W3)
, and in cell W3
is simply H3
. H3
contains a dollar amount with a specific font color assigned. This was necessary for the custom formula as it required an input of H3
rather than H3
... If that makes sense.
This is just a reference sheet I use to view payroll in my business, so I'm happy to reorganize it or modify any of these formulas/functions as necessary to make this work.
Thanks in advance for your assistance!