Well, I may be being a bit too tricky here. I have a text in column B, where if it starts with 'I', I want a hyperlink. If it starts with anything else, I want the result of some time calculation. The time calculation using the ArrayFormula() is fine, no need to fix that.
The problem is the Hyperlink is showing the text (it is not showing as a hyperlink) "Create next week activities" but the CreateNextWeek() function is not firing. This is the formula in my cell.
=if(left($B22,1)="I",HYPERLINK(CreateNextWeek(G22),"Create next week activities."),ArrayFormula(if(len(F22),F22+if(len(Q22),Q22,N22)/24,)))
In case anyone need my app script code, it is simply this:
function CreateNextWeek(originDate) {
var ss = SpreadsheetApp.getActive();
var title = 'Function Started';
var message='Create Next Week for after ' & originDate;
ss.toast(message,title);
}
I click on the cell, nothing happens. I think it has something to do with the cell needing to change from text mode to hyperlink mode and back again depending on my IF condition. Is that a possibility? Not sure how to fix that either, if it is the case. Soo, how do I make this cell behave the way I want it to work?