Sum Column based on cell values of another column

I have a table with column “Cycle”,“value” ,“type” and “media”. I need to sum up the value of the same cycle if the type and media is of certain values.

E.g

Cycle|value|type|Media
1    | 123 | A  | Air
1    | 132 | B  | Water
1    | 234 | A  | Air
2    | 122 | A  | Solid
2    | 453 | B  | Air
2    | 123 | A  | Air

In this case, row 1 and 3 has the same type and media and cycle so i need to sum the value together.
Filter table activity can filter the “type” and “media” but if i were to filter cycle too, i have to repeat a lot of times as there are a total of 26 cycles.
Is there a way to better sum the values of the same cycle together after filtering?

@Zac_Soh You need to Group By and Sum :sweat_smile: But the question is where do you want to Store the Summed Up Values or How?

@supermanPunch I need to to write it on a new sheet of a current excel. The format would be something like

Cycle| A+Air|A+Water|B+Air|B+water....
1    |357   | 0     |  0  |132 etc etc 

Another sheet would simply be just the total value of the combinations (type and media).

@Zac_Soh Can you send the Excel File, i think it’s a bit complicated to achieve it in the format you need, but i can try with Groupby and Check :sweat_smile:

You can use Sumifs Formula of excel Like this
=SUMIFS(B:B,A:A,“1”,C:C,“A”,D:D,“Air”)(For type A,Cycle C and Media air). Similarly you can use for all.

@supermanPunch
Book1.xlsx (26.6 KB)
I’ve highlighted the part that is relevant

@Shashi123 I’m sorry but i need a little more details, new to uipath and now experienced in excel. How do i apply that formula on uipath to write the datatable to new sheet?

@Zac_Soh Can you tell me in the provided Excel by which values do you need to Filter and Take Up the Sum?

@supermanPunch Column “Value” is the one i need to sum.

The condition to filter is on the 2nd sheet.
1st column would be the cycle, the others are the conditions of the filter.
E.g

1 | 12508 | 32723|624|

would mean that the total number for cycle 1 for each condition is that.

For column c and d,
C+2/3/4 & A+2/3/4 means that C+2,C+3,C+4,A+2,A+3,A+4 are the same group and the values are to sum together.

Hope i am clear enough

@Zac_Soh I’m sorry but I didn’t understand quite enough :sweat_smile:
What is meant by this C+2/3/4 & A+2/3/4?

@supermanPunch
The rows with conditions C & 2,3,4 (E.g row 9-11) and A 2,3,4 (E.g row 3 (A+2) ) are to sum together. The filtering would be something like