Can OR function be used with cross-sheet references?
I'm trying to use OR with SUMIFS in a cross-sheet calculation but it doesn't work. As an example the formula below yields a INVALID OPERATION error.
=SUMIFS({TotalCost}, {Cost Center}, [Cost Center]@row, OR({Reason} = "Other", {Reason} = "Training"), {Region}, "Domestic", {Approved}, 1, {Year}, "2020")
Thanks,
TY
Best Answer
-
Hi Ty,
Yes, OR can be used within a SUMIFS formula, however OR is a bit different than the way SUMIFS looks at the ranges. With the way you have it set up, you are looking to see if the entire range = one specific criteria (versus looking to see if a specific cell = a criteria).
We will need to make it more specific, looking @cell in each of the ranges instead of looking at the range as a whole. One way to do this would be with the HAS function built in (keep in mind HAS looks for an exact match). Like this:
{Reason}, OR(HAS(@cell, "Training"), HAS(@cell, "Other")
Try this:
=SUMIFS({TotalCost}, {Cost Center}, [Cost Center]@row, {Region}, "Domestic", {Approved}, 1, {Year}, "2020", {Reason}, OR(HAS(@cell, "Training"), HAS(@cell, "Other")))
Let me know if this works for you!
Genevieve
Need more help? 👀 | Help and Learning Center
こんにちは (Konnichiwa), Hallo, Hola, Bonjour, Olá, Ciao! 👋 | Global Discussions
Answers
-
Hi Ty,
Yes, OR can be used within a SUMIFS formula, however OR is a bit different than the way SUMIFS looks at the ranges. With the way you have it set up, you are looking to see if the entire range = one specific criteria (versus looking to see if a specific cell = a criteria).
We will need to make it more specific, looking @cell in each of the ranges instead of looking at the range as a whole. One way to do this would be with the HAS function built in (keep in mind HAS looks for an exact match). Like this:
{Reason}, OR(HAS(@cell, "Training"), HAS(@cell, "Other")
Try this:
=SUMIFS({TotalCost}, {Cost Center}, [Cost Center]@row, {Region}, "Domestic", {Approved}, 1, {Year}, "2020", {Reason}, OR(HAS(@cell, "Training"), HAS(@cell, "Other")))
Let me know if this works for you!
Genevieve
Need more help? 👀 | Help and Learning Center
こんにちは (Konnichiwa), Hallo, Hola, Bonjour, Olá, Ciao! 👋 | Global Discussions
-
Bingo! It worked. Thanks for the lesson Genevieve. This community is really useful.
-
Wonderful! So glad that worked for you, and happy to help. :)
Need more help? 👀 | Help and Learning Center
こんにちは (Konnichiwa), Hallo, Hola, Bonjour, Olá, Ciao! 👋 | Global Discussions
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Smartsheet Customer Resources
- 64.1K Get Help
- 414 Global Discussions
- 221 Industry Talk
- 461 Announcements
- 4.8K Ideas & Feature Requests
- 143 Brandfolder
- 141 Just for fun
- 58 Community Job Board
- 462 Show & Tell
- 32 Member Spotlight
- 1 SmartStories
- 299 Events
- 38 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!