SheetsAsker99
SheetsAsker99

Reputation: 25

How to sum data from multiple rows and columns according to unique search key in google sheets?

I am trying to sum the average total sales of each employee in this table. For example, Tim sold ten vehicles day 1, nine day 2, and eleven day 3, for an average of 10 per day. I tried using vlookup at first but this will only grab the first search_key, so because Tim shows up 3 times, I only get the result of the first day. Is there a way to use a similar function to vlookup (maybe filter?) to grab all of the columns each time the employee's name shows up, then average the total sales?

Upvotes: 2

Views: 98

Answers (1)

player0
player0

Reputation: 1

try:

=ARRAYFORMULA(QUERY({A2:A10, MMULT(C2:E10*1, SEQUENCE(COLUMNS(C2:E10), 1, 1, ))}, 
 "select Col1,sum(Col2) where Col1 is not null group by Col1 label sum(Col2)''"))

enter image description here

Upvotes: 2

Related Questions