Nested SUMIF+cross sheet formula

Kelly Ospina
Kelly Ospina ✭✭✭✭✭
edited 12/09/19 inFormulas and Functions

I am struggling with a formula.

I have two sheets. One is a list of proposals, the other is a material forecast roll-up.

I am trying to build a formula that will sum up the square feet noted for a particular product within a certain month and year, but I can't seem to get it right.

Here is what I have so far:

=SUMIFS({SqFt}:{SqFt}, {Roof System}, "Product A", AND(IF({Target Ship Date}, ISDATE(@cell), {Target Ship Date}, MONTH(@cell)= 6, {Target Ship Date}, YEAR(@cell)= 2018)))

I keep getting an "Unparsable" error message.

Any help in figuring out where I've gone wrong would be appreciated.

Thank you!

Tags:

Comments

  • Paul Newcome
    Paul Newcome ✭✭✭✭✭✭

    You have the right idea, but you are putting too much into it. The IF(S) part of SUMIF(S) implies that all statements are considered as IF statements. The function will also automatically consider all range/criteria sets to be "inside" of an AND function. You can get rid of the IF as well as the AND. That's how the function is already built to work, so adding them in goes against the correct syntax. (AND can be used in this function, but only as an efficiency when referencing the same range multiple times).

    Give this a shot...

    =SUMIFS({SqFt}:{SqFt}, {Roof System}, "Product A", {Target Ship Date}, ISDATE(@cell), {Target Ship Date}, MONTH(@cell)= 6, {Target Ship Date}, YEAR(@cell)= 2018)

    To expand on the last little bit where AND can be used when referencing multiple sets of criteria for the same range, I notice that you have the {Target Ship Date} referenced 3 times. This can be shortened like so...

    =SUMIFS({SqFt}:{SqFt}, {Roof System}, "Product A",@{Target Ship Date}, AND(ISDATE(@cell), MONTH(@cell)= 6, YEAR(@cell)= 2018))

    NOTE: You only enter the range one time. You then wrap your criteria in the AND function.

    thinkspi.com

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the公式手册模板!
@SarahI<\/a> Yes you can do that just use CHILDREN([COLUMN NAME])<\/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":106886,"type":"question","name":"Risk and Opportunity Matrix - IF\/AND Statements","excerpt":"Hello, I am trying to utilize a Risk & Opportunity Matrix to assign priority levels to risks and opportunities. I am using this formula to try to do this but I keep getting an #INCORRECT ARGUMENT. Does anyone know why? I even tried a test with only one IF\/AND statement to see if it works and I still get the same message.…","categoryID":322,"dateInserted":"2023-06-26T13:58:31+00:00","dateUpdated":"2023-06-26T14:10:30+00:00","dateLastComment":"2023-06-26T15:19:16+00:00","insertUserID":162759,"insertUser":{"userID":162759,"name":"sophiaashepard","title":"Project Manager","url":"https:\/\/community.smartsheet.com\/profile\/sophiaashepard","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2023-06-26T15:30:21+00:00","banned":0,"punished":0,"private":false,"label":"✭"},"updateUserID":162759,"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-06-26T15:19:24+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭✭✭"},"pinned":false,"pinLocation":null,"closed":false,"sink":false,"countComments":2,"countViews":20,"score":null,"hot":3375581867,"url":"https:\/\/community.smartsheet.com\/discussion\/106886\/risk-and-opportunity-matrix-if-and-statements","canonicalUrl":"https:\/\/community.smartsheet.com\/discussion\/106886\/risk-and-opportunity-matrix-if-and-statements","format":"Rich","lastPost":{"discussionID":106886,"commentID":382299,"name":"Re: Risk and Opportunity Matrix - IF\/AND Statements","url":"https:\/\/community.smartsheet.com\/discussion\/comment\/382299#Comment_382299","dateInserted":"2023-06-26T15:19:16+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-06-26T15:19:24+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭✭✭"}},"breadcrumbs":[{"name":"Home","url":"https:\/\/community.smartsheet.com\/"},{"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\/AXPIZGR6E5VK\/matrix-png.png","urlSrcSet":{"10":"","300":"","800":"","1200":"","1600":""},"alt":"Matrix.PNG"},"attributes":{"question":{"status":"accepted","dateAccepted":"2023-06-26T15:30:19+00:00","dateAnswered":"2023-06-26T15:19:16+00:00","acceptedAnswers":[{"commentID":382299,"body":"

Looks like you are forgetting to close out your AND function(s).<\/p>

=IF(AND(.......), <\/strong>\"Critical\")<\/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":106881,"type":"question","name":"Calculate % complete with Date Range and Today's date","excerpt":"Hello community, I need a formula to return % Complete based on a start - end date range and today's date. So for example: Date Range: 06\/18\/23 - 06\/30\/23 Today's date: 06\/26\/23 As there are 12days in this date range, and today's date is day 8 out of 12, the percentage complete would be 66.6% Thanks in advance!","categoryID":322,"dateInserted":"2023-06-26T11:40:17+00:00","dateUpdated":null,"dateLastComment":"2023-06-26T15:14:49+00:00","insertUserID":143463,"insertUser":{"userID":143463,"name":"Sam Swain","url":"https:\/\/community.smartsheet.com\/profile\/Sam%20Swain","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2023-06-26T15:15:08+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-06-26T15:19:24+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭✭✭"},"pinned":false,"pinLocation":null,"closed":false,"sink":false,"countComments":6,"countViews":44,"score":null,"hot":3375575706,"url":"https:\/\/community.smartsheet.com\/discussion\/106881\/calculate-complete-with-date-range-and-todays-date","canonicalUrl":"https:\/\/community.smartsheet.com\/discussion\/106881\/calculate-complete-with-date-range-and-todays-date","format":"Rich","tagIDs":[254],"lastPost":{"discussionID":106881,"commentID":382293,"name":"Re: Calculate % complete with Date Range and Today's date","url":"https:\/\/community.smartsheet.com\/discussion\/comment\/382293#Comment_382293","dateInserted":"2023-06-26T15:14:49+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-06-26T15:19:24+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭✭✭"}},"breadcrumbs":[{"name":"Home","url":"https:\/\/community.smartsheet.com\/"},{"name":"Formulas and Functions","url":"https:\/\/community.smartsheet.com\/categories\/formulas-and-functions"}],"groupID":null,"statusID":3,"attributes":{"question":{"status":"accepted","dateAccepted":"2023-06-26T13:50:37+00:00","dateAnswered":"2023-06-26T13:24:44+00:00","acceptedAnswers":[{"commentID":382268,"body":"

=MAX(MIN((TODAY() - Start@row) \/ (Finish@row - Start@row), 1), 0)<\/p>


<\/p>

This does the percentage:<\/p>

(TODAY() - Start@row) \/ (Finish@row - Start@row)<\/p>


<\/p>

This caps it at 100%:<\/p>

MIN(..............., 1)<\/p>


<\/p>

This keeps it from going negative for future tasks:<\/p>

MAX(..............., 0)<\/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":[{"tagID":254,"urlcode":"Formulas","name":"Formulas"}]}],"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