Lindsay
Lindsay

Reputation: 1

Need a google sheets script to sort data by column value

I have a spreadsheet of my department's priorities and initiatives for the year, it has about 10-15 columns. I'd like to create a series of executable buttons to place at the top of the report for easy access to filtering the sheet by certain values. For example, one button may say "show completed items" and when clicked the script would sort the "Status" column show only the rows with completed as the value in that column. The trick here is that I want these filters to run by clicking on the image so they would need to be done in script. I'm a beginning user of scripts so any help would be much appreciated.

In my sheet these are the column headers

Col 1 Pillar
Col 2 Strategy
Col 3 Initiative
Col 4 Priority
Col 5 Quarter Delivered*
Col 6 P&C Owner Col 7 Partners
Col 8 Current Status
Col 9 Start Date
Col 10 End Date Col 11 Status Notes

Thank you

Upvotes: 0

Views: 1162

Answers (2)

daniel
daniel

Reputation: 648

The best way is to save your filters. Saved filters are accessible by all viewers.

For steps on how to do this, go to Filter your data, scroll down so you see "Create, name, and save a filter view", then select "Create and save filter view"

After you saved your filter views, you can access them from the drop down menu on the filter button.

Upvotes: 1

Noam Hacker
Noam Hacker

Reputation: 4825

Google has some great documentation for their Apps Script, which includes help with writing scripts for Google Sheets. Just go here and click "Build an add-on", and I'm sure SO would be glad to help once you come up with some more specific programming questions.

Upvotes: 0

Related Questions