In my Google spreadsheet (the newest version, as of August 2014) I'm using =IMPORTRANGE(P5,"Tasks!b6:o7")
where P5
cell contains another spreadhsheet's key. One of the cells in the other spreadsheet contains my custom function, that sometimes takes time to calculate (there are dozens of cells using that function). The problem is that in the first spr. that cell's value is not displayed properly, the #N/A
error message is displayed instead.
The function is defined as follows:
// global variable
var ONEDAY = 24*60*60*1000; // hours*minutes*seconds*milliseconds
function _mySimpleCalculateDaysDifference(DateToBeChecked)
{
var todaysDate = new Date();
var todaysDayModifier = todaysDate.getHours()<6?-1:0;
var daysDiff = (todaysDate.getTime() - DateToBeChecked.getTime())/ONEDAY;
return Math.floor(daysDiff) + todaysDayModifier;
}
It's being called the following way:
=if((H18>0),(H18-F18),if((F18>0),_mySimpleCalculateDaysDifference(F18),""))
where F
and H
columns contain date values.
Is there any way to solve that problem?
Edit:
I mentioned that the main spreadhsheet is the newest Google spreadsheet, but those being pulled in were 'old'.
IMPORTRANGE
). I've recently migrated the 'importing' spreadsheet into the new google spreadsheets. Before it was OK. – ellockie