Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I have to sum columns based on parameter mentioned in table. Below is input table -
Name | Merge Column | Column1 | Column2 | Column3 | Column4 | Column5 |
A | 1 | 1 | 2 | 3 | 4 | 5 |
B | 2 | 1 | 2 | 3 | 4 | 5 |
C | 3 | 1 | 2 | 3 | 4 | 5 |
D | 2 | 1 | 2 | 3 | 4 | 5 |
E | 4 | 1 | 2 | 3 | 4 | 5 |
Merge Column is a parameter on which columns should be summed up and result should be shown in columns.
for ex - Name B. 2 is mentioned in merge column then column1+column2 is added and result should be shown in column1 (same for column 3 and 4). If merge column=1 then leave it as it is.
For merge column=3. 3 consecutive column should be added and sum should be shown in 1st column.
Expected output-
Name | Merge Column | Column1 | Column2 | Column3 | Column4 | Column5 |
A | 1 | 1 | 2 | 3 | 4 | 5 |
B | 2 | 3 | 7 | 5 | ||
C | 3 | 6 | 9 | |||
D | 2 | 3 | 7 | 5 | ||
E | 4 | 10 | 5 |
Hello!
I don't understand, how did you calculate values to Column 2 and Column 3.
For ex. Name = 'B' (Column2 = 7,Column3=5) and Name = 'C'(Column2 = 9, Value from Column3 is empty)
Hi Anton,
for Name = 'B' (Column1 = Column1+Column2,
Column2 = Column3+Column4,
Column3=Column5+Column6)
because Merge column =2.
Since Column6 is not available that's why column3=column5
for Name = 'C' (Column1 = Column1+Column2+Column3,
Column2 = Column4+Column5+Column6)
because Merge column =3.
Since Column6 is not available that's why column2=Column4+Column5
You can create different table for Output.