SUM IF with OR and CHILDREN
Hello,
I am trying to add one additional condition to this statement below, but can't seem to figure it out.
Here's what I have currently (which works):
=IF($[Row Identifier - Budget]@row = "Parent", SUMIF(CHILDREN([Alt Cost Center]@row), "", CHILDREN()), "")
And I'd like to add an additional option that says if [Alt FY]@row has data in it, to also follow the same protocol. They both do not need to be true, just one or the other.
Here's my work in progress...any help is much appreciated!
=IF($[Row Identifier - Budget]@row = "Parent", SUMIFS(CHILDREN([Alt Cost Center]@row, "", OR[Alt FY]@row)), "", CHILDREN())
Answers
-
It isn't possible to do what you are trying to do. OR can only be used in SUMIFS or COUNTIFS to check for two conditions in the same column.
What you want to do is create two different SUMIFS statements, and then add them together.
=IF($[Row Identifier - Budget]@row = "Parent",FIRST_SUMIF_STATEMENT + SECOND_SUMIF_STATEMENT)
-
Ah! Thank you @SJ . Do I need to repeat CHILDREN()), "") after each SUMIF or only at the end of the added SUMIFs?
-
This works! But it doubles my budget column amount. How do I get these to operate independently from one another?
=IF($[Row Identifier - Budget]@row = "Parent", SUMIF(CHILDREN([Alt FY]@row), "", CHILDREN())) + SUMIF(CHILDREN([Alt Cost Center]@row), "", CHILDREN())
-
It might help to have a screenshot of your data to suggest the best approach.
If your budget is being doubled, I'm guessing that you have rows that meet both conditions - is that right? If that is the case, you would want to then SUBTRACT the budget amounts where both conditions are true using a SUMIFS.
Like this:
=IF($[Row Identifier - Budget]@row = "Parent", SUMIF(CHILDREN([Alt FY]@row), "", CHILDREN())) + SUMIF(CHILDREN([Alt Cost Center]@row), "", CHILDREN()) - SUMIFS(CHILDREN(), CHILDREN([Alt Cost Center]@row), "", CHILDREN([Alt FY]@row), "")
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Smartsheet Customer Resources
- 62.2K Get Help
- 360 Global Discussions
- 199 Industry Talk
- 427 Announcements
- 4.4K Ideas & Feature Requests
- 136 Brandfolder
- 127 Just for fun
- 128 Community Job Board
- 444 Show & Tell
- 28 Member Spotlight
- 1 SmartStories
- 283 Events
- 35 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!