D
D
Dmitry Klimantovich2020-10-11 19:57:15
Google Sheets
Dmitry Klimantovich, 2020-10-11 19:57:15

How to simplify the summation formula by conditions?

Task: From the sum of all values ​​in the "Values ​​1" column, subtract the sum of all values ​​in the "Values ​​1" column on whose row in the "Condition" column the "text1" condition is met and add the sum of all values ​​in the "Values ​​2" column on whose row in the "Condition" column does not fulfill the "text 1" condition.
That is, simplified somehow like this: Amounts (Values ​​1) - (Amounts (values ​​1), where on the same line there is a value "text 1" in the "condition" column + sums (values ​​2), where on the same line there is in the column "condition" value "text 1").

I got it like this:

=СУММ(Значения1) - ( СУММ(Значения2) - СУММЕСЛИ(Условие;"текст1";Значения1) + СУММЕСЛИ(Условие;"текст1";Значения2) )


But how can this long string be shortened? Or just like that?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2020-10-12
@ForestAndGarden

=СУММ(
Значения1;
Значения2;
-СУММЕСЛИ(
  Условия1;
  "текст1";
  Значения1);
-СУММЕСЛИ(
  Условия2;
  "текст1";
  Значения2)
)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question