作为一名前程序员,我喜欢干净,可维护和文档化的代码。在Excel中清洁代码?
作为一名项目经理,我不得不复杂的擅长不时,并希望写我写程序的“干净”公式。
(如何)我可以添加 “意见” 为(多)的公式?
(How)我可以“命名”(细胞相关)公式并重用它吗? (例如,它写的VB(或参数甚至F#)函数)
例1:代替
=IF(AND(L$11+(L$13-1)*7>=$C15;L$11+(L$13-1)*7<$D15);VLOOKUP($A15;RessourcePlan;12+$E15;WRONG);0)
我想写:
// check if this columns (L) date is inbetween startdate (Col C) and enddate (Col D)
=IF (AND(L$11+(L$13-1)*7>=$C15;L$11+(L$13-1)*7<$D15);
// then select the the utilisation (12+E15) for the resp. team from the resource plan
VLOOKUP($A15;RessourcePlan;12+$E15;WRONG);
// else default to 0
0
) //ENDIF
,而是example1我可能会写一个用户自定义函数(UDF)
Function Utilization(thisDate As Date, task As String) As Double
... // clean VB or F# code
End Function
然后写
=Utilization(L11,A15)
“将”注释“添加到(多行)公式中”在我看来,与“清洁”相反。 – pnuts 2015-02-06 14:49:00
恕我直言,它比复杂的oneliner更好,它的意义/内部工作原理在写作后几天我不记得了。我添加一个例子... – Bastl 2015-02-06 16:26:50
你有没有尝试过使用.net的excel互操作? – mydogisbox 2015-02-06 17:49:07