下圖,就是朋友的工作。左邊四個欄位是原始資料。最右邊的output 欄位是他要透過查表,才能寫出公司的 part number 型號。
怎樣算是半自動解呢?由於解除儲存格,將儲存格填滿的部分,對於業務來說,其實是很容易的,也不太耗時間,這個部分就還是由人手工來做。我只用程式處理最後的查表工作。
同時,仔細想想,用 script language 去處理 csv 檔,就會需要朋友手動做匯出。其實這個操作對一般人很不直覺。
既然需要的資料都已經在同一個 row 上了,就寫了一隻使用者自訂函數來處理。
在 John Bentley 所著 Programming Pearls 一書中,也有一段話寫到相似的解題想法 ---
Keeping track of our organization's budget looked difficult to me. Out of habit, I would have built a large program for the job, with a clunky user interface. The next programmer took a broader view, and implemented the program as a spreadsheet, supplemented by a few functions in Visual Basic. The interface was totally natural for the accounting people who were the main users.