Sum of Squares Using the SUMSQ Function in Google Sheets

This article is part of the Google Sheets function guide, where we explore different functions and their usage in Google Sheets. In this post, we will dive into the SUMSQ function and learn how to use it to calculate the sum of squares in Google Sheets.

What is the SUMSQ Function?

The SUMSQ function is a math function in Google Sheets that allows you to calculate the sum of squares of a given series of values or numbers. It is a useful tool when working with data that requires squaring and summing values.

Syntax and Arguments of the SUMSQ Function

The syntax of the SUMSQ function is as follows:

SUMSQ(value1, [value2, ...])

Here’s a breakdown of the arguments (parameters) used in the SUMSQ function:

  • value1: The first number or array whose squares will be added together.
  • value2, ...: Additional numbers or arrays whose squares will be added to the square of the first argument.

It’s important to note that value1 is required, while the subsequent arguments are optional. You can include as many values or arrays as you need.

Examples of Using the SUMSQ Function

Let’s look at some examples to understand how the SUMSQ function works:

  • Example 1: Using only one value as the parameter
=sumsq(5)

The above formula will return 25, which is the square of the number 5. In this case, since there’s only one number within the SUMSQ function, it is equal to value1^2.

  • Example 2: Using multiple values as parameters
=sumsq(5, 5, 2)

In this example, the formula is equal to 5*5 + 5*5 + 2*2, which results in 54.

You can also use cell references or named ranges as arguments within the SUMSQ function. For a detailed explanation and examples of these types of usage, you can refer to this link.

Alternatives to the SUMSQ Function

While the SUMSQ function is useful for calculating the sum of squares, there are alternative formulas that can achieve the same result. Here are a few alternatives using other functions in Google Sheets:

  • Using POWER function:
=ArrayFormula(sum(power(N(A1:B3),2)))
  • Using POW function:
=ArrayFormula(sum(pow(N(A1:B3),2)))
  • Using the caret symbol (^):
=ArrayFormula(sum(N(A1:B3)^2))
  • Using SUMPRODUCT function:
=sumproduct(N(A1:B3)^2)

These formulas will provide the sum of squares of a series of numbers, similar to the SUMSQ function. However, it’s important to note that these alternatives may treat boolean values (TRUE/FALSE) differently compared to SUMSQ. You can choose the formula that suits your specific needs.

Conditional Sum of Squares in Google Sheets

Currently, there is no SUMSQIF or SUMSQIFS function available in Google Sheets. However, you can achieve a conditional sum of squares using other functions like FILTER and QUERY.

For example, to calculate the sum of squares of numbers in column A only if the corresponding values in column B are “Yes,” you can use the FILTER function:

=sumsq(filter(A1:A, B1:B="Yes"))

Alternatively, you can use the QUERY function to achieve the same result:

=sumsq(query(A1:B, "Select A where B='Yes'"))

By utilizing these functions, you can easily perform conditional sum of squares with single or multiple conditions.

Conclusion

In this article, we explored the SUMSQ function in Google Sheets and learned how it can be used to calculate the sum of squares. We also discussed alternatives to the SUMSQ function and how to achieve conditional sum of squares using other functions like FILTER and QUERY. Now, you can confidently work with the SUMSQ function and leverage its power in your data analysis tasks. Happy calculating!

Sum of Squares

Related posts