Find cumulative percentage

Hi team

I need to find the cumulative percentage
I have a table with the following content:

Field Label Group Count Percentage Cumulative %
MTART e3r5 16 43.24
MTART fr6y44 11 29.73
MTART 1q2 10 27.03

In this table in the last column in need to add a cumulative percentage
so the output will look like this:

Field Label Group Count Percentage Cumulative %
MTART e3r5 16 43.24 43.24
MTART fr6y44 11 29.73 72.97
MTART 1q2 10 27.03 100

so how can I do it?

Hi @Aishwarya_Bhargava ,

Have you tried Excel Mixed references?

The cumulative total for first data row is SUM(D$2:D2)

Observe that D$2 is a placeholder and when you apply the formula for each cell, it will add the amounts in all previous rows to the current row.

Here is your example in action.

image

As for putting it into RPA, Excel packages contain activities to apply formula from one cell to all the cells in that column. I think it is Autofill Range Excel Activity.

I hope this helps.

This workflow is an alternative that could be used inside Studio:

Forum_Cumulative%.xaml (3.7 KB)

Best,
Charbel

The file is empty @Charbel1

I cant specify the column as it will change with respect to the different no. of table that i append @AndyMenon

Forum_Cumulative%.xaml (7.1 KB)
My bad.

Well you have to have logic to determine what the cell is in that case. The Robot isn’t expected to know that unless you do.

If the cumulative total column is the last one, it makes this task that much easier. In this case you will need to read the top row of that table into a DataTable, and the number of columns will help you determine which cell is the Cumulative total column.

Example: If the total number of columns in your DataTable is 4, then the last column is D.

You can use this information to apply the cumulative formula to that cell.

Thanks

Can you please explain each of the steps in detail?
@Charbel1

I made a few changes to the script and that worked correctly thankyou
I gave the range starting from 0 instead of 1
and then I initialized the value of the first cell of cumulative % same as the percentage cell
and then for the rest of the values where I was not equal to zero, I did the addition for the same row percentage and above cell cumulative percentage

Great! Glad it helped. :slight_smile:

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.