8/31/2023 0 Comments Auto summarize records* Below is a helper function that filters a 2-dimenstional array.Sembly can be that small yet impactful solution that delivers value at a large scale. Let overdueCnt = filterByPosition(values,'Overdue', columnStatus).length Counts the number of tasks that have the 'Overdue' status. Let scheduledCnt = filterByPosition(values,'Scheduled', columnStatus).length Counts the number of tasks that have the 'Scheduled' status. Let inProgressCnt = filterByPosition(values,'In-Progress', columnStatus).length Counts the number of tasks that have the 'In-Progress' status. Let completeCnt = filterByPosition(values,'Complete', columnStatus).length To add more options, copy the line below and update the string to the new text. If the options you want to count in your spreadsheet differ, update the strings below to match the text of each option. Counts the number of tasks that have the 'Complete' status. Gets the 'Owner Name' column value by retrieving the first data row in the array. Let columnStatus = headerRowValues.indexOf("Status") Let columnOwner = headerRowValues.indexOf("Owner Name") Using 'indexOf()' to get the position of each column prevents the script from breaking if the columns change positions in a sheet. Finds the columns with the heading names 'Owner Name' and 'Status' and gets the index value of each. Gets the first row of the sheet which is the header row. Let values = sheets.getDataRange().getValues() The sheets you want to summarize must have columns with headers that match the names of the columns this function summarizes data from. See the License for the specific language governing permissions and WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. Unless required by applicable law or agreed to in writing, softwareĭistributed under the License is distributed on an "AS IS" BASIS, You may not use this file except in compliance with the License. Licensed under the Apache License, Version 2.0 (the "License") To learn how to use this script, refer to the documentation: To review the Apps Script code for this solution, click View source code
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |