top 10 interview questions for JavaScript

🔥 Mastering JavaScript: Top 10 Interview Questions and Answers! 🔥 Elevate your JavaScript interview game with these must-know questions and comprehensive answers. Whether you’re prepping for a technical interview or simply deepening your JavaScript knowledge, these insights are gold. Keep these insights close to ace those JavaScript interviews and deepen your understanding. Whether you’re diving … Read more

10 tips with code examples for JavaScript developers

🚀 Elevate Your JavaScript Coding Skills with These Top 10 Tips! 🚀 Are you a JavaScript enthusiast looking to level up your coding game? Check out these essential tips that can make a significant impact on your coding efficiency and style. 💻🔥 1. Variable Declarations: Embrace modern variable declarations like const and let for improved … Read more

Create Apps Script custom functions How to get the total amount of items including the tax rate

How to get the total amount of items including the tax rate  CALC_TOTAL_AMOUNT Product Price Quantity Tax Rate Subtotal Total Amount Product A 10 5 0.08 4 54 Product B 20 3 0.05 3 63 Product C 15 2 0.1 3 33 Total 150 In this example, we’ll create a custom formula that calculates the … Read more

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