0

My dataset comes from a Google formular.
I will have 2 different entries with the same names.

this is how the dataset looks like

The data input in the different columns will increase.

What I want to do now is automatically subtract the data from the same columns between the 2 rows with the same names in column A.

that's how the result should look like

I only could get the sum function to work like that, but I need the minus function.

=query(A:B, "select A, sum(B) group by A")

This one works for the sum, but I need to subtract the first entry from the 2nd one.

I would really appreciate some help.
The query function is needed, because that's not the only thing I want to do.

2 Answers 2

0

Based solely on what you've shown in your post (which is all we have to go on), you will only ever have two instances of any given name: one with a lower number for the name and one with a higher number for the name.

Give that condition:

=query(A:B, "select A, max(B)-min(B) where A is not null group by A label max(B)-min(B) ''")

I've written this in the style of the formula you originally presented, rather than in my own style, so that it will be most understandable to you.

0

thank you very much, that helps! I will even have more than 2 entries of the same name later on, would it maybe be possible to select the 2 instances I use for the substraction based on dates when the entry from the google form was made?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.