Home > OS >  Sum range in Google Sheets of only unique values
Sum range in Google Sheets of only unique values

Time:06-15

I need a formula to sum a column of values. But I only want to sum the rows that have an ID that are unique among the entire range. See the example below where I have 6 rows, but there are only 3 unique IDs. My ideal outcome is a sum of 6 by adding one instance of UNIQUEID-00A, UNIQUEID-00B, and UNIQUEID-00C.

Notes:

  • A unique ID will always have the same value. For example, if UNIQUEID-00A were listed 1 or 100 times, the associated value will always be 1. So I don't need the formula to account for a scenario where the duplicate IDs have different values.
  • There may be instances where Column A (the ID) and Column B (the value) will not be sitting side-by-side. It might be that 2, 3, or more columns are in between the two columns.
  • The IDs and values could be 6 rows tall, or hundreds of rows tall. For that reason I'd like to use something like A2:A to target the IDs rather than having to specify a specific start and end point like A2:A7.

See the linked Google Sheet below for a copy of this.

ID Value
UNIQUEID-00A 1
UNIQUEID-00B 2
UNIQUEID-00C 3
UNIQUEID-00A 1
UNIQUEID-00B 2
UNIQUEID-00C 3

enter image description here

  • sum B column
  • while returning all rows 9^9
  • that are unique 2
  • within A column
  • in whatever order 1
  • Related