Fork me on Github

Fork me on GitHub

Mar 11, 2012

Google Apps Script - Find from right

I am getting familiar with Google Spreadsheets and Google Apps Script.

For a sheet used for expense tracking I needed a findFromRight function in Google Apps Script.

I let myself be inspired from the Excel VBA world and found something from Chris Rae's site that could be modified:



To add testing to this Google Apps Script, I decided to try out the GAS-Unit testing framework.




There are two ways to view the test results. The code above only prints to the log view (View-> Logs in the menus). It is also possible to receive the test result as a formatted report per mail (by including the outcommented line and updating the email address).

All in all, I find that using the testing framework can be of good help to establish that the functions are working as expected (and keep working as expected when redesigned).

Mar 4, 2012

Select arrays in Microsoft Excel 2010

I am getting comfortable with changing from Excel 2003 to Excel 2010.

One difference that I have noticed in the two versions, is how the array formula entry behaves on already existing arrays (pressing ctrl-shift return).

In Excel 2003, after array formula entry, the current array gets selected.
In Excel 2010, after array formula entry, the current cell gets selected.

Please see illustrated example below:

Excel 2003

A basic array formula is entered


After array formula entry (ctrl-shift return), the current array is selected


Excel 2010
A basic array formula is entered

After array formula entry (ctrl-shift return), the current cell is selected

If we want to select the current array in Excel 2010, another method is necessary
Select goto special in the ribbon menu

and choose current array in the panel that shows