New Google Sheets custom functions sometimes display “Loading…” indefinitely

后端 未结 13 1652
没有蜡笔的小新
没有蜡笔的小新 2020-12-24 06:34

SPECIFIC FOR: \"NEW\" google sheets only.

This is a known issue as highlighted by google in the new sheets.

Issues: If you write complex* custom f

13条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-24 07:00

    In my case, the cell was stuck with a Loading... message due to "probably" a race condition between functions and formulas resolutions.

    This is my custom function:

    function ifBlank(value1, value2) {
      return !!value1 ? value1 : value2;
    }
    

    This is the formula calling it: =IFBLANK(VLOOKUP($A2,Overrides!$A$2:$E,5,FALSE),VLOOKUP($A2,'_resourceReq'!$A$2:$C,3)) Those VLOOKUP values could be pretty complex and could also take some time to resolve.

    Solution: (in my case)

    Wrapping the VLOOKUP() into TO_TEXT() or VALUE() for example.

    So, changing the formula to =IFBLANK(TO_TEXT(VLOOKUP($A2,Overrides!$A$2:$E,5,FALSE)),TO_TEXT(VLOOKUP($A2,'_resourceReq'!$A$2:$C,3))) worked well.

    If that doesn't work maybe try resolving the value from a function into a cell before using it as the argument of your custom function.

提交回复
热议问题