Can you use OR in a SUMIFS formula

I have a sheet full of data from a form that is sent out each month to multiple groups of people regarding multiple different properties. I have 4 quantifiable questions on the form that I have been using the following formula on to collect data. Example below

=SUMIFS({Broker Report Test 2 Range 1}, {Broker Activity Report Range 6}, "January", {Broker Activity Report Range 1}, "EMORY DECATUR III")

^^So I am getting the sum of "Number of Suites Canvassed" IF the "reporting month" is "January" AND if the "property name" is "EMORY DECATUR III"



What I would like to do is get the sum as I am above for "number of suites canvassed" in the month of "January" but I would like to reference multiple property names for example "EMORY DECATUR I" or "EMORY DECATUR II" or "EMORY DECATUR III". So I would like the total of suites canvassed in January for all 3 properties previously listed.


I am having trouble getting this to work in a formula and not sure if it is even possible.

Best Answer

  • DKazatsky2
    DKazatsky2 ✭✭✭✭
    Answer ✓

    Hi@haliecarr,

    Give this a try.

    =SUMIFS({Broker Report Test 2 Range 1}, {Broker Activity Report Range 6}, "January", {Broker Activity Report Range 1}, OR(@cell = "EMORY DECATUR I",@cell = "EMORY DECATUR II",@cell = "EMORY DECATUR III"))

    Hope this helps,

    Dave

Answers

  • DKazatsky2
    DKazatsky2 ✭✭✭✭
    Answer ✓

    Hi@haliecarr,

    Give this a try.

    =SUMIFS({Broker Report Test 2 Range 1}, {Broker Activity Report Range 6}, "January", {Broker Activity Report Range 1}, OR(@cell = "EMORY DECATUR I",@cell = "EMORY DECATUR II",@cell = "EMORY DECATUR III"))

    Hope this helps,

    Dave

  • @DKazatsky2thank you so much! That worked! I saw the "@ cell" listed somewhere when I was trying to look this up and was thinking I needed to reference a cell not actually type that. So thank you again!!

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out theFormula Handbook template!
Hi @Heather P.<\/a>,<\/p>

Try this:<\/p>

=RIGHT((LEFT([Max Date]@row, 6)), 2) + \"\/\" + RIGHT([Max Date]@row, 2) + \"\/\" + LEFT([Max Date]@row, 4)<\/p>

I tested and here are the results: <\/p>

\n
\n \n \"image.png\"<\/img><\/a>\n <\/div>\n<\/div>\n


<\/p>"}]}},"status":{"statusID":3,"name":"Accepted","state":"closed","recordType":"discussion","recordSubType":"question"},"bookmarked":false,"unread":false,"category":{"categoryID":322,"name":"Formulas and Functions","url":"https:\/\/community.smartsheet.com\/categories\/formulas-and-functions","allowedDiscussionTypes":[]},"reactions":[{"tagID":3,"urlcode":"Promote","name":"Promote","class":"Positive","hasReacted":false,"reactionValue":5,"count":0},{"tagID":5,"urlcode":"Insightful","name":"Insightful","class":"Positive","hasReacted":false,"reactionValue":1,"count":0},{"tagID":11,"urlcode":"Up","name":"Vote Up","class":"Positive","hasReacted":false,"reactionValue":1,"count":0},{"tagID":13,"urlcode":"Awesome","name":"Awesome","class":"Positive","hasReacted":false,"reactionValue":1,"count":0}],"tags":[]},{"discussionID":111244,"type":"question","name":"Help with nested if and statements","excerpt":"I have an assessment with different factors to create a final score. There are four individual results that factor in. First determines critical vs non-critical. If \"Critical\" and any of four individual scores are \"No\" then 0 pts, if \"Yes\" then 4 pts, if \"Non-Critical\" and 1 of the four individual scores are \"No\" then…","snippet":"I have an assessment with different factors to create a final score. There are four individual results that factor in. First determines critical vs non-critical. If \"Critical\" and…","categoryID":322,"dateInserted":"2023-10-05T12:23:49+00:00","dateUpdated":"2023-10-05T12:50:52+00:00","dateLastComment":"2023-10-05T15:50:56+00:00","insertUserID":131807,"insertUser":{"userID":131807,"name":"Lara Kelly","url":"https:\/\/community.smartsheet.com\/profile\/Lara%20Kelly","photoUrl":"https:\/\/aws.smartsheet.com\/storageProxy\/image\/images\/u!1!e5DE50spI1Q!nPHBH51xhnw!D2j2PsO7E0a","dateLastActive":"2023-10-05T16:04:12+00:00","banned":0,"punished":0,"private":false,"label":"✭✭"},"updateUserID":131807,"lastUserID":151203,"lastUser":{"userID":151203,"name":"Nick Korna","url":"https:\/\/community.smartsheet.com\/profile\/Nick%20Korna","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2023-10-05T16:00:46+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭✭✭"},"pinned":false,"pinLocation":null,"closed":false,"sink":false,"countComments":3,"countViews":31,"score":null,"hot":3393031485,"url":"https:\/\/community.smartsheet.com\/discussion\/111244\/help-with-nested-if-and-statements","canonicalUrl":"https:\/\/community.smartsheet.com\/discussion\/111244\/help-with-nested-if-and-statements","format":"Rich","lastPost":{"discussionID":111244,"commentID":398652,"name":"Re: Help with nested if and statements","url":"https:\/\/community.smartsheet.com\/discussion\/comment\/398652#Comment_398652","dateInserted":"2023-10-05T15:50:56+00:00","insertUserID":151203,"insertUser":{"userID":151203,"name":"Nick Korna","url":"https:\/\/community.smartsheet.com\/profile\/Nick%20Korna","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2023-10-05T16:00:46+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭✭✭"}},"breadcrumbs":[{"name":"Home","url":"https:\/\/community.smartsheet.com\/"},{"name":"Get Help","url":"https:\/\/community.smartsheet.com\/categories\/get-help"},{"name":"Formulas and Functions","url":"https:\/\/community.smartsheet.com\/categories\/formulas-and-functions"}],"groupID":null,"statusID":3,"image":{"url":"https:\/\/us.v-cdn.net\/6031209\/uploads\/YKS5MT5IMMBD\/image.png","urlSrcSet":{"10":"https:\/\/us.v-cdn.net\/cdn-cgi\/image\/fit=scale-down,width=10\/https:\/\/us.v-cdn.net\/6031209\/uploads\/YKS5MT5IMMBD\/image.png","300":"https:\/\/us.v-cdn.net\/cdn-cgi\/image\/fit=scale-down,width=300\/https:\/\/us.v-cdn.net\/6031209\/uploads\/YKS5MT5IMMBD\/image.png","800":"https:\/\/us.v-cdn.net\/cdn-cgi\/image\/fit=scale-down,width=800\/https:\/\/us.v-cdn.net\/6031209\/uploads\/YKS5MT5IMMBD\/image.png","1200":"https:\/\/us.v-cdn.net\/cdn-cgi\/image\/fit=scale-down,width=1200\/https:\/\/us.v-cdn.net\/6031209\/uploads\/YKS5MT5IMMBD\/image.png","1600":"https:\/\/us.v-cdn.net\/cdn-cgi\/image\/fit=scale-down,width=1600\/https:\/\/us.v-cdn.net\/6031209\/uploads\/YKS5MT5IMMBD\/image.png"},"alt":"image.png"},"attributes":{"question":{"status":"accepted","dateAccepted":"2023-10-05T15:46:54+00:00","dateAnswered":"2023-10-05T13:24:08+00:00","acceptedAnswers":[{"commentID":398577,"body":"

Hi @Lara Kelly<\/a>,<\/p>

I think this is what you're after:<\/p>

=IF(OR(AND([Critical\/Non-Critical]@row = \"Critical\", COUNTIF([Result-1]@row:[Result-4]@row, \"Yes\") >= 1, COUNTIF([Result-1]@row:[Result-4]@row, \"No\") = 0), AND([Critical\/Non-Critical]@row = \"Non-Critical\", COUNTIF([Result-1]@row:[Result-4]@row, \"Yes\") = 4)), 4, IF(AND([Critical\/Non-Critical]@row = \"Non-Critical\", COUNTIF([Result-1]@row:[Result-4]@row, \"No\") = 1), 2, 0))<\/p>

Sample output:<\/p>

\n
\n \n \"image.png\"<\/img><\/a>\n <\/div>\n<\/div>\n

The position of a Yes\/No\/blank won't matter due to using COUNTIF.<\/p>

If I've misunderstood one of the criteria or you've any problems\/questions then please advise. 🙂<\/span><\/p>"},{"commentID":398650,"body":"

@Nick Korna<\/a> Thank you! This works.<\/p>"}]}},"status":{"statusID":3,"name":"Accepted","state":"closed","recordType":"discussion","recordSubType":"question"},"bookmarked":false,"unread":false,"category":{"categoryID":322,"name":"Formulas and Functions","url":"https:\/\/community.smartsheet.com\/categories\/formulas-and-functions","allowedDiscussionTypes":[]},"reactions":[{"tagID":3,"urlcode":"Promote","name":"Promote","class":"Positive","hasReacted":false,"reactionValue":5,"count":0},{"tagID":5,"urlcode":"Insightful","name":"Insightful","class":"Positive","hasReacted":false,"reactionValue":1,"count":0},{"tagID":11,"urlcode":"Up","name":"Vote Up","class":"Positive","hasReacted":false,"reactionValue":1,"count":0},{"tagID":13,"urlcode":"Awesome","name":"Awesome","class":"Positive","hasReacted":false,"reactionValue":1,"count":0}],"tags":[]},{"discussionID":111207,"type":"question","name":"Vlookup Error","excerpt":"Trying to create a vlookup that will check for a circuit on the first sheet and return the site code from the second sheet, but I keep getting the Invalid Data Type error. =VLOOKUP(Circuit@row, {Site Bandwidth Range Circuit}, {Site Bandwidth Range Site Code}, false) Lookup Sheet What silly thing am I doing wrong?","snippet":"Trying to create a vlookup that will check for a circuit on the first sheet and return the site code from the second sheet, but I keep getting the Invalid Data Type error.…","categoryID":322,"dateInserted":"2023-10-04T18:49:32+00:00","dateUpdated":null,"dateLastComment":"2023-10-05T14:48:15+00:00","insertUserID":167683,"insertUser":{"userID":167683,"name":"aurea","title":"Program Manager","url":"https:\/\/community.smartsheet.com\/profile\/aurea","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2023-10-05T12:22:15+00:00","banned":0,"punished":0,"private":false,"label":"✭"},"updateUserID":null,"lastUserID":45516,"lastUser":{"userID":45516,"name":"Paul Newcome","title":"","url":"https:\/\/community.smartsheet.com\/profile\/Paul%20Newcome","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/userpics\/082\/nQPUTVFKKWDJ2.jpg","dateLastActive":"2023-10-05T14:56:26+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭✭✭"},"pinned":false,"pinLocation":null,"closed":false,"sink":false,"countComments":3,"countViews":25,"score":null,"hot":3392964467,"url":"https:\/\/community.smartsheet.com\/discussion\/111207\/vlookup-error","canonicalUrl":"https:\/\/community.smartsheet.com\/discussion\/111207\/vlookup-error","format":"Rich","lastPost":{"discussionID":111207,"commentID":398615,"name":"Re: Vlookup Error","url":"https:\/\/community.smartsheet.com\/discussion\/comment\/398615#Comment_398615","dateInserted":"2023-10-05T14:48:15+00:00","insertUserID":45516,"insertUser":{"userID":45516,"name":"Paul Newcome","title":"","url":"https:\/\/community.smartsheet.com\/profile\/Paul%20Newcome","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/userpics\/082\/nQPUTVFKKWDJ2.jpg","dateLastActive":"2023-10-05T14:56:26+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭✭✭"}},"breadcrumbs":[{"name":"Home","url":"https:\/\/community.smartsheet.com\/"},{"name":"Get Help","url":"https:\/\/community.smartsheet.com\/categories\/get-help"},{"name":"Formulas and Functions","url":"https:\/\/community.smartsheet.com\/categories\/formulas-and-functions"}],"groupID":null,"statusID":3,"image":{"url":"https:\/\/us.v-cdn.net\/6031209\/uploads\/D7A3DDIT0JLL\/image.png","urlSrcSet":{"10":"https:\/\/us.v-cdn.net\/cdn-cgi\/image\/fit=scale-down,width=10\/https:\/\/us.v-cdn.net\/6031209\/uploads\/D7A3DDIT0JLL\/image.png","300":"https:\/\/us.v-cdn.net\/cdn-cgi\/image\/fit=scale-down,width=300\/https:\/\/us.v-cdn.net\/6031209\/uploads\/D7A3DDIT0JLL\/image.png","800":"https:\/\/us.v-cdn.net\/cdn-cgi\/image\/fit=scale-down,width=800\/https:\/\/us.v-cdn.net\/6031209\/uploads\/D7A3DDIT0JLL\/image.png","1200":"https:\/\/us.v-cdn.net\/cdn-cgi\/image\/fit=scale-down,width=1200\/https:\/\/us.v-cdn.net\/6031209\/uploads\/D7A3DDIT0JLL\/image.png","1600":"https:\/\/us.v-cdn.net\/cdn-cgi\/image\/fit=scale-down,width=1600\/https:\/\/us.v-cdn.net\/6031209\/uploads\/D7A3DDIT0JLL\/image.png"},"alt":"image.png"},"attributes":{"question":{"status":"accepted","dateAccepted":"2023-10-05T12:47:26+00:00","dateAnswered":"2023-10-04T23:16:50+00:00","acceptedAnswers":[{"commentID":398510,"body":"

Try an INDEX\/MATCH instead.<\/p>

=IFERROR(INDEX({Site Code}, MATCH(Circuit@row, {Circuit}, 0)), \"//www.santa-greenland.com/community/discussion/111200/\")<\/p>"}]}},"status":{"statusID":3,"name":"Accepted","state":"closed","recordType":"discussion","recordSubType":"question"},"bookmarked":false,"unread":false,"category":{"categoryID":322,"name":"Formulas and Functions","url":"https:\/\/community.smartsheet.com\/categories\/formulas-and-functions","allowedDiscussionTypes":[]},"reactions":[{"tagID":3,"urlcode":"Promote","name":"Promote","class":"Positive","hasReacted":false,"reactionValue":5,"count":0},{"tagID":5,"urlcode":"Insightful","name":"Insightful","class":"Positive","hasReacted":false,"reactionValue":1,"count":0},{"tagID":11,"urlcode":"Up","name":"Vote Up","class":"Positive","hasReacted":false,"reactionValue":1,"count":0},{"tagID":13,"urlcode":"Awesome","name":"Awesome","class":"Positive","hasReacted":false,"reactionValue":1,"count":0}],"tags":[]}],"initialPaging":{"nextURL":"https:\/\/community.smartsheet.com\/api\/v2\/discussions?page=2&categoryID=322&includeChildCategories=1&type%5B0%5D=Question&excludeHiddenCategories=1&sort=-hot&limit=3&expand%5B0%5D=all&expand%5B1%5D=-body&expand%5B2%5D=insertUser&expand%5B3%5D=lastUser&status=accepted","prevURL":null,"currentPage":1,"total":10000,"limit":3},"title":"Trending in Formulas and Functions ","subtitle":null,"description":null,"noCheckboxes":true,"containerOptions":[],"discussionOptions":[]}">

Trending in Formulas and Functions