Warning: Opening Excel Files with Array Formulas in Google Sheets
From time to time, you might have to work with both Excel and Google Sheets interchangeably.
Generally, opening fairly standard Excel Files in Google Sheets works fine – Google has strong support for most Excel functions.
More complex or large worksheets generally fail to open in Google Sheets – not ideal, but at least there’s no hiding from the fact it doesn’t support your file – it just won’t open
However, I’ve recently come across a scenario whereby Google Sheets does open and display an Excel file – but doesn’t calculate the formula correctly and so displays incorrect data.
In a file sent to me recently, a user had created a SUMIF formula, but because he needed to allow multiple text values in the condition, he created it as an Array Formula
As you can see, this gives a ‘Final’ figure of 6,055,859
When I receive this file (as an Excel File) via a Gmail / Google Apps linked account, I have the option of ‘previewing’ the file. And here everything looks great too
However, things go a little awry when we open the file into Google Sheets
As you can see, all my figures now differ from the one I was expecting.
Now, the cause of this difference is fairly straightforward – whilst most Functions are cross-compatible between Excel and Google Sheets, Array Formulas is one area where they differ in approach.
Rather than converting my formula, or even not display it, Google Sheets is instead trying to process the function ignoring the array – so instead of matching against values ’01’,’02’,’03’, it’s only matching value ’01’
Again, the fix (in this case) is quite simple – we converted the text values into numeric ones and re-wrote out formula without the Array.
But the real issue here is that Google Sheets should recognise that it’s receiving an Excel Array Formula, and whilst it would be nice if it could ‘correct’ it, the next best option would be to fail safe and not show the value, so at least we’d not run the risk of people looking at the values and making incorrect decisions.