Luke
Luke

Reputation: 193

Sharing a sheet with formulas separated by commas to someone in a region that uses semi-colons

I have a sheet that I want to share with various people. The formulas I use are input through Apps Script as they need to be changed. I separate the various parts by commas. For example,

function example(){sheet.getRange(1, 1).setFormula("=SUM(10, 20)")}

Some of the people I share with have settings to use semi-colons. For example,

function example2(){sheet.getRange(1, 1).setFormula("=SUM(10; 20)")}

They get an #ERROR for all my formulas. I did some research but don't see a general solution for when they are input by apps script. I would have thought Google would translate the formulas but it doesn't seem so when they are input with range.setformula.

I found this, but it just seems to help figure out how to change it. I want it to change automatically or somehow function for anyone who opens it.

Upvotes: 1

Views: 284

Answers (1)

Wicket
Wicket

Reputation: 38371

Using United States as Locale, Google Sheets supports SUM(10, 20) and SUM(10; 20) but using a Locale that uses comma as decimal separator, i.e. Argentina, doesn't, so what about this "fix"

instead of using SUM(10, 20) use SUM(10; 20)

in other words, use semicolon always as the formula parameter separator.

Related

Upvotes: 2

Related Questions