Google Sheets get Data from two sheets to use within a custom function

How to use data from two sheets to create a custom Apps Script function  CALC_TOTAL_COST_WITH_TAX function getTaxRate(category) { const sheets = SpreadsheetApp.getActive().getSheetByName(‘TaxTable’); const taxTable = sheets.getDataRange().getValues(); let tax = 0 taxTable.forEach(val =>{ if (val[0] == category) { tax = val[1]; } }) return tax; } function test(){ Logger.log(getTaxRate(‘Category 1’)) } Category Tax Rate Category 1 … Read more

Custom Google Apps Script for Sheets create and apply discount percentages

CALC_DIS(qty, cost, discount): This function calculates the total cost for a particular quantity of items, given their individual cost and a discount rate. It takes three parameters: qty (quantity), cost (individual cost of each item), and discount (discount rate as a decimal between 0 and 1).Inside the function, a variable named total is initialized to … Read more

Get the total cost custom sheets formula calculate values across ranges

In this tutorial, we walk you through the creation of a custom formula using Google Apps Script in Google Sheets, allowing you to automatically calculate total costs for items and generate an overall expenditure. Summary: Managing calculations in spreadsheets becomes a breeze with this custom formula: Step 1 – Setup: Step 2 – Writing Code: … Read more

Calculate a weighted Average from a range of values

WEIGHTED_AVERAGE  Value Weight 10 0.1 15 0.1 5 1 Result 6.25 Scenario: You want to create a custom Google Sheets formula that calculates the weighted average of values in a specified range, where each value is multiplied by its corresponding weight. Data Table: A B C 1 Value Weight 2 10 0.3 3 15 0.5 … Read more

Calculate average from range above a threshold

AVERAGE_ABOVE_THRESHOLD 7 4 9.333333333 6 10.66666667 15 11.33333333 11 8 In this example, we’ll create a custom formula that calculates the average of a range of numbers, excluding any values that are less than a specified threshold. Scenario: You have a range of numbers in column A and a threshold value in cell B1. You … Read more

August Udemy Course Coupons Learn Google Apps Script Web Development Coding and more

Use the promo code AU2023 to get the BEST PRICE POSSIBLE on my courses! I’ve selected the below courses for you! CSS Modern Responsive Web Design Create 5 Different Sites https://www.udemy.com/course/web-design-css/?couponCode=AU2023 Google Sheets Tips Tricks Quick HowTo Workspace Resources https://www.udemy.com/course/google-sheets-course/?couponCode=AU2023 Modern Web Design Beginners HTML CSS JavaScript 25+ Projects https://www.udemy.com/course/modern-web-design/?couponCode=AU2023 Complete JavaScript Projects Course Games … Read more

Top Summer Courses Udemy Course Coupons 2023 July-August

Use the promo code SUMMER23 on my courses for the next 4 days to get the BEST PRICE POSSIBLE!!! This is the biggest sale ever. Google Sheets Tips Tricks Quick HowTo Workspace Resources 5+hrs Video Content https://www.udemy.com/course/google-sheets-course/?couponCode=SUMMER23 Highest Rated!!! – 4.7 Stars – 14.5 hrs HD video content HTML5 Canvas create 5 Games 5 Projects … Read more

JavaScript DOM update page element text contents

To update the text content of an element in the DOM (Document Object Model) using JavaScript, you can use several methods depending on the situation and the specific element you want to update. Here are some common approaches: <div id=”myElement”>This is the initial text.</div> const element = document.getElementById(‘myElement’); element.textContent = ‘This is the updated text.’; … Read more