Tutorial: Arrayformula in Google Sheets, good practices & how to overcome Arrayformula restrictions with scripts

This concept app does exactly that (and more)…

1 Like

Sorry, did not understand how to use arrayformula to count the exact number of True in several columns. I wrote the numbers I expect in red square.
img-2021-04-05-23-33-26

What layout do you expect? Do you want a checklist or do you want something like what Darren did in the link he provided?

Either way, the idea is to use a relation and have a joined list column linking all the items chosen together, then write them to the Sheet using a set column action.

2 Likes

Here’s the formula to do so.

1 Like

Ok I will try that strategy then. What I was expecting is for the User to fill out a form and can select multiple options at once from a list.
i.e. Food Cuisines App
Options: “French, Chinese, American, Peruvian”
User Selects : “French, Peruvian” as their 2 options

Then question is followed by Favorite Areas To Eat
Options: “Houston, Scottsdale, Salem”
User Selects: “Houston, Scottsdale” as their options

Then Google Sheet holds
User’s Name
Users Food Cuisine
Users Favorite Places to Eat.

Not sure how to do it so that the User isn’t selecting from separate dropdowns each time in order to create a list :frowning:

Best,

Holal @bradsigep,

This post mught give you an idea of how to do it. Reset Multiple Rows At Once

Do you really need that info in the Sheet? Not saying that it can’t be done, but it would be easy if you don’t require that. You can store those boolean values in user-specific columns and give users a checklist layout.

Thanks for this tutorial @ThinhDinh, I just used it on a project and it worked flawlessly :+1: :+1:

1 Like

Glad it could have helped!

Do I need a glide account to make it run?
Where do I need to paste the =fillFormula() function?

I renamed the script to my sheetsname, adjusted the range to my specific range, but it didn’t work. I would apreciate it a lot, if some could make a youtube video on how to use this script to make a stocks tickers symbol list dynamic to e.g. the stocks last price when new tickers are added.

No, you don’t need a Glide account to make those scripts run.

Here’s a walkthrough from Ben Collins: https://www.benlcollins.com/apps-script/google-apps-script-beginner-guide/

If you still need me to help with this, please share your Sheet to ariesarsenal@gmail.com.

2 Likes

Hi @ThinhDinh ,
I just now discovered your tutorial which was what I needed. As usual well done, with lots of examples, but is something missing in my Google Sheet? For example I can’t find in edit the whole section about triggers. Also, it gives me this error: The matrix result was not expanded because it would have overwritten the data in D1?? :frowning:

I am trying to split a geolocation (ex: 45.995211,12.86631) into two columns (lat/lon), using the SPLIT formula and adding the ARRAYFORMULA:
={“Lat”,ARRAYFORMULA(INDEX(SPLIT(A2:A,","),1))}
={“Lon”,ARRAYFORMULA(INDEX(SPLIT(A2:A,","),2))}

Where am I wrong? Thanks as always

In there anything in cell D1?
Arrayformulas will not expand if it means over writing existing data.

Do you actually need this in the Google Sheet?
If not, you’ll find it much easier with a simple Split Text column in your Glide Table. You could then use a couple of Single Value columns to address each of the Lat/Long values.

YES I need it because in the same sheet I use Google Maps functions and if I do it inside glide with calculated columns, they would not show up in Google Sheet.

Yes in D1 I have a column, as well as in the adjacent ones. Using ARRAYFORMULA should I leave the columns to the right free?

It looks like the comma after “Lat” and “Lon” should be a semicolon instead.

I’m not sure if INDEX works with arrayformula, if it doesn’t work the right way please tell me.

1 Like

Hi @ThinhDinh

I use arrayformula as follows: =ARRAYFORMULA(IF(ISBLANK(AE2:AE),“”,AE2:AE+AR2:AR+BE2:BE)) on cell BK2. Then, I format BK column with the number formula: Rp1,000 as image below. But, when I insert/input a new row, the number format doesn’t work to a new number (cell BK5). And, I have to reformat the numbers manually :upside_down_face:

Do you know how to solve this problem?

Thanks in advance

Is there any particular reason you are not use a math column in glide to calculate that result, and then formatting it within glide?

Because the numbers are related to its Google app script. I can’t use a math column for GAS. Do you have any suggestion @Jeff_Hager?

Do you need it to be a number? If you can live with it being a text, I think you can just add “Rp” to the formula before you calculate it.

=ARRAYFORMULA(IF(ISBLANK(AE2:AE),“”,"Rp"&AE2:AE+AR2:AR+BE2:BE)) 
1 Like

Yes, I need it to be a number. Is it possible?