Is there a way to use SumIF to add values in a column that match a specific text string in adjacent

Burt L
Burt L
edited 12/09/19 inFormulas and Functions

We are building estimate sheets using a hierarchy based on Construction Specifications Institute's organizational coding system. I have rows nested using multiple parent / children. The top level is the CSI Division, which has children rows with specific categories within that Division, and each Category line has nested rows with more specific rows breaking that item down into more granular detail. I'm using conditional formatting and =sum(children) functions to roll up totals up the hierarchy. This works well as it's easy to add rows at any level of the hierarchy and easy to set up filters to see the sheet with rows visible by level of parent / child hierarchy.

I want to pull values from a "Quantity" column where the cell contains a number (or a formula that produces a number). A cell in the adjacent column "Unit" on the row contains a text string such as "Shr" for superintendent hour or "Chr" for carpenter hour. The quantity cell is a vlookup formula that pulls a billable hourly rate from another sheet.

I cannot figure out how to create a formula that will sum the total hours in the Quantity column that match a specific text entry in the "Unit" column.

Comments

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the公式手册模板!
Hi Yuval,<\/strong> <\/p>

You can try this formula for your condition- <\/p>

=IF(AND([Materials in Rigotec\/Talad]@row = true, [Materials in CR]@row = true, [HC in Place]@row = true, [QA\/QC done before install]@row = true), \"Green\", IF(AND([Materials in Rigotec\/Talad]@row = false, [Materials in CR]@row = false, [HC in Place]@row = false, [QA\/QC done before install]@row = false), \"//www.santa-greenland.com/community/discussion/43606/\", IF(OR([Materials in Rigotec\/Talad]@row = false, [Materials in CR]@row = false, [HC in Place]@row = false, [QA\/QC done before install]@row = false), \"Red\"))) <\/p>

Hope this will work for you <\/p>"},{"commentID":389689,"body":"

Cool, many thanks Kaveri, working as watch, just copy and paste, perfect<\/p>

Yuval<\/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":108670,"type":"question","name":"Counting options selected in Multi-Select Column","excerpt":"Is there a way to count the number of options selected in a multi-select column in another column? Column3 here has the result we are looking for.","snippet":"Is there a way to count the number of options selected in a multi-select column in another column? Column3 here has the result we are looking for.","categoryID":322,"dateInserted":"2023-08-08T16:37:06+00:00","dateUpdated":null,"dateLastComment":"2023-08-08T17:15:22+00:00","insertUserID":164753,"insertUser":{"userID":164753,"name":"DuayneB","title":"IT","url":"https:\/\/community.smartsheet.com\/profile\/DuayneB","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2023-08-08T17:14:37+00:00","banned":0,"punished":0,"private":false,"label":"✭"},"updateUserID":null,"lastUserID":164753,"lastUser":{"userID":164753,"name":"DuayneB","title":"IT","url":"https:\/\/community.smartsheet.com\/profile\/DuayneB","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2023-08-08T17:14:37+00:00","banned":0,"punished":0,"private":false,"label":"✭"},"pinned":false,"pinLocation":null,"closed":false,"sink":false,"countComments":2,"countViews":35,"score":null,"hot":3383028748,"url":"https:\/\/community.smartsheet.com\/discussion\/108670\/counting-options-selected-in-multi-select-column","canonicalUrl":"https:\/\/community.smartsheet.com\/discussion\/108670\/counting-options-selected-in-multi-select-column","format":"Rich","lastPost":{"discussionID":108670,"commentID":389569,"name":"Re: Counting options selected in Multi-Select Column","url":"https:\/\/community.smartsheet.com\/discussion\/comment\/389569#Comment_389569","dateInserted":"2023-08-08T17:15:22+00:00","insertUserID":164753,"insertUser":{"userID":164753,"name":"DuayneB","title":"IT","url":"https:\/\/community.smartsheet.com\/profile\/DuayneB","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2023-08-08T17:14:37+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\/FI9I5AGQT2FT\/image.png","urlSrcSet":{"10":"","300":"","800":"","1200":"","1600":""},"alt":"image.png"},"attributes":{"question":{"status":"accepted","dateAccepted":"2023-08-08T17:14:36+00:00","dateAnswered":"2023-08-08T16:49:56+00:00","acceptedAnswers":[{"commentID":389560,"body":"

@DuayneB<\/a> Use the COUNTM() function<\/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":108666,"type":"question","name":"MONTH function returning #INVALID DATA TYPE because it is blank","excerpt":"How can I use the MONTH function if the cell is blank? It is returning #INVALID DATA TYPE. I'm pulling this information into 3 columns from the Actual Submission Date Column: \"Month\" - new column with the following formula: =MONTH(([Actual Submission Date]@row)) \"Year\" - new column with the following formula: =YEAR([Actual…","snippet":"How can I use the MONTH function if the cell is blank? It is returning #INVALID DATA TYPE. I'm pulling this information into 3 columns from the Actual Submission Date Column:…","categoryID":322,"dateInserted":"2023-08-08T15:04:40+00:00","dateUpdated":null,"dateLastComment":"2023-08-08T15:36:57+00:00","insertUserID":164504,"insertUser":{"userID":164504,"name":"jwilson","title":"Jwilson","url":"https:\/\/community.smartsheet.com\/profile\/jwilson","photoUrl":"https:\/\/aws.smartsheet.com\/storageProxy\/image\/images\/u!1!ZmPpGa_xdbI!zF8os1PhyPo!OK7q4j_Bn9V","dateLastActive":"2023-08-08T16:46:49+00:00","banned":0,"punished":0,"private":false,"label":"✭"},"updateUserID":null,"lastUserID":161714,"lastUser":{"userID":161714,"name":"Carson Penticuff","url":"https:\/\/community.smartsheet.com\/profile\/Carson%20Penticuff","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/userpics\/B0Q390EZX8XK\/nBGT0U1689CN6.jpg","dateLastActive":"2023-08-09T04:29:41+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭✭"},"pinned":false,"pinLocation":null,"closed":false,"sink":false,"countComments":4,"countViews":44,"score":null,"hot":3383018497,"url":"https:\/\/community.smartsheet.com\/discussion\/108666\/month-function-returning-invalid-data-type-because-it-is-blank","canonicalUrl":"https:\/\/community.smartsheet.com\/discussion\/108666\/month-function-returning-invalid-data-type-because-it-is-blank","format":"Rich","lastPost":{"discussionID":108666,"commentID":389540,"name":"Re: MONTH function returning #INVALID DATA TYPE because it is blank","url":"https:\/\/community.smartsheet.com\/discussion\/comment\/389540#Comment_389540","dateInserted":"2023-08-08T15:36:57+00:00","insertUserID":161714,"insertUser":{"userID":161714,"name":"Carson Penticuff","url":"https:\/\/community.smartsheet.com\/profile\/Carson%20Penticuff","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/userpics\/B0Q390EZX8XK\/nBGT0U1689CN6.jpg","dateLastActive":"2023-08-09T04:29:41+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,"attributes":{"question":{"status":"accepted","dateAccepted":"2023-08-08T16:23:58+00:00","dateAnswered":"2023-08-08T15:29:07+00:00","acceptedAnswers":[{"commentID":389533,"body":"

Hi @jwilson<\/a> <\/p>

I hope you're well and safe!<\/p>

Try something like this.<\/p>

Edited because I was thinking of a cross-sheet range.<\/p>

Try this.<\/p>

=IFERROR(MONTH([Actual Submission Date]@row), \"//www.santa-greenland.com/community/discussion/43606/\")<\/p>

Did that work\/help?<\/p>

I hope that helps!<\/p>

Be safe, and have a fantastic week!<\/p>

Best,<\/p>

Andrée Starå<\/strong><\/a> | Workflow Consultant \/ CEO @ WORK BOLD<\/strong><\/a><\/p>

Did my post(s) help or answer your question or solve your problem? Please support the Community by <\/em>marking it Insightful\/Vote Up, Awesome, or\/and as the accepted answer<\/em><\/strong>. It will make it easier for others to find a solution or help to answer!<\/em><\/p>"},{"commentID":389540,"body":"

Are you using the Month and Year columns simply as a way to pull out that information to fill in the MM\/YYYY column? If so, you can eliminate those columns entirely and directly pull the data into the MM\/YYYY column.<\/p>

=IFERROR(IF(MONTH([Actual Submission Date]@row) < 10, \"0\", \"//www.santa-greenland.com/community/discussion/43606/\") + MONTH([Actual Submission Date]@row) + \"\/\" + YEAR([Actual Submission Date]@row), \"//www.santa-greenland.com/community/discussion/43606/\")<\/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