Sumif multiple columns
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi masters,
I would like to create a total column base on the following "IF" logic:
IF Type='E' THEN sum(A1:A6) ELSE sum(B1:B6) ENDIF
Account | Org | Type | A1 | A2 | A3 | A4 | A5 | A6 | B1 | B2 | B3 | B4 | B5 | B6 |
003325 | 011 | E | 13 | - | 18 | 22 | 45 | 3 | 11 | 16 | - | 29 | 16 | 21 |
220910 | 018 | B | 2 | 32 | 24 | - | 17 | 26 | 33 | 45 | 22 | 07 | - | 18 |
220910 | 011 | B | 3 | 12 | 11 | 16 | - | 29 | 21 | 13 | 29 | 16 | 21 | 13 |
001318 | 013 | E | 29 | 16 | 21 | 13 | 29 | 16 | 13 | 29 | 16 | 21 | 13 | 29 |
001318 | 018 | B | 17 | 26 | 8 | 33 | 45 | 22 | 3 | 12 | 11 | 16 | - | 45 |
003325 | 011 | E | 45 | 3 | 16 | 21 | 13 | 29 | - | 29 | 16 | 16 | - | 29 |
The expected result should have a total column as following:
Account | Org | Type | Total |
003325 | 011 | E | 101 |
220910 | 018 | B | 125 |
220910 | 011 | B | 113 |
001318 | 013 | E | 124 |
001318 | 018 | B | 87 |
003325 | 011 | E | 127 |
Thanks for your help
Solved! Go to Solution.
- Labels:
- Best Practices
- Expression
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Here is one way of doing this.
Your first and last row of the expected output should be summed, right?
Account | Org | Type | Total |
003325 | 011 | E | 101 |
220910 | 018 | B | 125 |
220910 | 011 | B | 113 |
001318 | 013 | E | 124 |
001318 | 018 | B | 87 |
003325 | 011 | E | 127 |
If the provided answer helped you to solve the problem/was correct, please accept it as a solution :)
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
One way of doing this.
The first and last row of your example should be summarized, right?
Account | Org | Type | Total |
003325 | 011 | E | 101 |
220910 | 018 | B | 125 |
220910 | 011 | B | 113 |
001318 | 013 | E | 124 |
001318 | 018 | B | 87 |
003325 | 011 | E | 127 |
If the provided answer helped you to solve the problem/was correct, please accept it as a solution :)
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi, @Felipe_Amancio
Maybe you need this output:
Formula of [Value] :
IF [Type]="E" && left([Name], 1)="A" THEN [Value]
ELSEIF [Type]!="E" && left([Name], 1)!="A" THEN [Value]
ELSE 0 ENDIF
***********
If it can help you get want result, please mark it as a solution and give a like for more share.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
If the number of columns is constant over time, you can always just use a simple formula tool
if [Type] = "E" then
[A1]+[A2]+[A3]+[A4]+[A5]+[A6]
else
[B1]+[B2]+[B3]+[B4]+[B5]+[B6]
endif
Dan
