SUMIFS not working (referencing another sheet)

I'm struggling with getting a SUMIFS function to work properly that is referencing another sheet.

So on my sheet with the function, I have it as:

=SUMIFS({Total GL Detail Range 4}, {Total GL Detail Range 5}, Project8, {Total GL Detail Range 3},[email protected])

...where the "Total GL Detail" is the other sheet referenced. Range 4 is the column of dollar amounts I'm wanting to summarize, Range 5 is a column of project ID numbers (and the Project8 cell referenced is the location in the current sheet where the specific project ID I want is referenced), and Range 3 is a column of three words ("Revenue", "Cost", and "Margin"[email protected]is the location in the current sheet where the word "Revenue" is referenced). So I'm basically trying to summarize data based on a specific Project ID and for a specific type of dollar (Revenue).

The function just gives me a $0 when the total should be an actual sum of dollars. Any idea where I'm going wrong? (Or if there's a smarter way to do this?) Thank you!

Best Answer

  • Paul Newcome
    Paul Newcome ✭✭✭✭✭✭
    Answer ✓

    好的。I just had someone else earlier this week have the same issue. Even after converting all of the IDs to text it still wasn't working. Lets try converting everything on the source sheet to numbers. Take that LEFT formula you have that strips the ID out and wrap it in a VALUE function.

    =VALUE(LEFT(.......................))


    Then try the COUNTIFS on the ID again, but instead of referencing the helper cell in the formula sheet that we created, reference the linked cell that houses the numerical value.

    thinkspi.com

«1

Answers

  • Paul Newcome
    Paul Newcome ✭✭✭✭✭✭

    There are a number of reasons for this to output a zero, so lets start with the most basic and work our way down the list from there.


    How exactly are the dollar amounts in the source sheet being populated?

    thinkspi.com

  • The dollars are being populated by a function. The specific function is:[email protected]which references another column in that sheet which is actually another function itself.

  • Paul Newcome
    Paul Newcome ✭✭✭✭✭✭

    What is that source function?

    thinkspi.com

  • The function in the Net column is:[email protected]-[email protected]which references two other columns in that source sheet. The Debit and Credit columns contain data (no functions) that was pasted in from Excel. If there is ever a Debit amount, there is no corresponding credit amount directly beside it in the same row (and vice versa with the Credit column). The goal of the Net column is to compile both columns together with all debit amounts showing as positive and all credit amounts showing as negative. The purpose of the Dollars column (which is the Range 4 in the initial function in the other sheet) is to flip the signs. (For other purposes, I wanted two columns showing the signs going both ways.) Both the Net column and the Dollars column are setup as function columns, not as cell functions.

    (I apologize for my naivety...I'm brand new to Smartsheet.)

  • Paul Newcome
    Paul Newcome ✭✭✭✭✭✭

    So it sounds like we are definitely pulling in numbers. We can move on to the next piece. Your ID columns...


    How are they populated, and are you able to provide some samples of that data?

    thinkspi.com

  • So the Project ID numbers are the Primary column and are also a column function. They are simply six digit numbers like "409642". The function in the column is:=LEFT([TS Project - Full Name]@row, 6)which references another column that has the project's full name and number (e.g. "409642 - Project X" and it's always in that format). That "TS Project - Full Name" column is also another column function and is:=MID([Line Description]@row, (FIND("#", [Line Description]@row) + 1), 100)which strips data from a "Line Description" column that has pasted data in from Excel. The project numbers and names always follow the # sign in the Line Description.

  • Paul Newcome
    Paul Newcome ✭✭✭✭✭✭

    I think we may be on to something. How are you entering the project numbers in the second sheet (the one with the SUMIFS)?

    thinkspi.com

  • So the SUMIFS function pulls the Project ID number from another cell in the same sheet (so not the referenced sheet). That cell is in a different column but is merely down below my data. Right now, the cell is linked to another third sheet (called "Project Metadata"), but I've tried it where the Project ID number was merely hard-keyed in (still $0 result) as well as the Project ID number being linked in another separate cell in the sheet but then merely referenced in the cell that is used in the SUMIFS function (still $0 result). I've always either gotten a $0 or an error as an answer (can't remember exactly what error I've gotten in the past).

    I attached a screenshot of the sheet where the SUMIFS formula is found...the cell where the SUMIFS formula lies is in the cell boxed in red and the Project ID number is pointed out with a blue arrow.

    Example.pdf


  • Paul Newcome
    Paul Newcome ✭✭✭✭✭✭

    好的。我想我们可能已经发现了这个问题。在你的screenshot, the linked in cell containing the project number is right justified. Assuming you have not applied any formatting to that cell, this shows that it is being stored as a numerical value. MID and LEFT functions output text strings. While they may LOOK the same, one is considered a number and the other is considered text which means you aren't going to get a match.


    在你的most recent screenshot, enter this into the cell immediately to the right of the project number that is being linked in:

    [email protected]+ ""


    "Adding" double quotes to the end of the cell reference like that will convert it from a number to a text string. You should see that this new one is now right justified within the cell.


    What happens if you reference this instead of the linked in ID?

    =SUMIFS({Total GL Detail Range 4}, {Total GL Detail Range 5},[Revised Budget]8, {Total GL Detail Range 3},[email protected])

    thinkspi.com

  • That makes sense...I've made that change now but it's still showing as $0 so I'm wondering if there's something else at play here. But at least that issue has been fixed.

    I've attached an updated screenshot as well as a screenshot of the columns (ranges) used in the function from the sourced sheet in case there's anything visual that would help there

    Example updated.pdf
    Source Sheet.pdf

    .

  • Paul Newcome
    Paul Newcome ✭✭✭✭✭✭

    唯一留下的是πece, but that looks like it should be ok based on your screenshots. Lets switch over to a COUNTIFS for a little bit to do some additional troubleshoot.

    We can start with two different ones. One for each of the range/criteria sets (ID and Title done separately).

    =COUNTIFS({Total GL Detail Range 5}, [Revised Budget]8)

    =COUNTIFS({Total GL Detail Range 3},[email protected])

    thinkspi.com

  • Okay so the first COUNTIFS function on the Project ID numbers (the [Revised Budget]8 cell) came up with 0 which means it's not working correctly.

    The other COUNTIFS function (the[email protected]cell) worked appropriately and counted a total of 19 instances of the word "Revenue".

    So it's something to do with the Project ID numbers from the source sheet...

  • Paul Newcome
    Paul Newcome ✭✭✭✭✭✭
    Answer ✓

    好的。I just had someone else earlier this week have the same issue. Even after converting all of the IDs to text it still wasn't working. Lets try converting everything on the source sheet to numbers. Take that LEFT formula you have that strips the ID out and wrap it in a VALUE function.

    =VALUE(LEFT(.......................))


    Then try the COUNTIFS on the ID again, but instead of referencing the helper cell in the formula sheet that we created, reference the linked cell that houses the numerical value.

    thinkspi.com

  • AHA! That worked!! And oddly enough, I didn't even need to change the helper cell reference that was in text form. It worked with both the text cell and the numerical cell. Just had to be sure to change the range it was referencing to numeric.

    Thank you so much!!

  • Paul Newcome
    Paul Newcome ✭✭✭✭✭✭

    Happy to help.


    @Genevieve P.Have there been any changes that you know of that would impact this functionality?

    In the past, if we had an ID column that had leading zeros on some but not in others, we could use the [Column Name]@row + "" method to convert everything into text, and matches would work just fine. This one is now twice this week that it didn't work and we had to use the VALUE function to convert the IDs into numbers to get it to work.

    thinkspi.com

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out theFormula Handbook template!
Try IF([payment voucher]@row=0,Sum([Parking Revenue Regular]@row:[Private boat parking revenue]@row),\"//www.santa-greenland.com/community/discussion/comment/\")<\/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":106883,"type":"question","name":"Needing some help with my current smartsheet project","excerpt":"So I'm coming across some issues with my workflows and functions with my current sheet, and I'm hoping somebody could help me out because I'm stumped. There are boxes I have set up on children rows that get checked manually to confirm a certain portion of the Main Task is complete. I'm currently in search of a way I can…","categoryID":322,"dateInserted":"2023-06-26T13:40:29+00:00","dateUpdated":null,"dateLastComment":"2023-06-26T20:13:57+00:00","insertUserID":162756,"insertUser":{"userID":162756,"name":"SarahI","title":"Sarah","url":"https:\/\/community.smartsheet.com\/profile\/SarahI","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2023-06-26T19:19:04+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-26T20:54:28+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭✭✭"},"pinned":false,"pinLocation":null,"closed":false,"sink":false,"countComments":8,"countViews":42,"score":null,"hot":3375602066,"url":"https:\/\/community.smartsheet.com\/discussion\/106883\/needing-some-help-with-my-current-smartsheet-project","canonicalUrl":"https:\/\/community.smartsheet.com\/discussion\/106883\/needing-some-help-with-my-current-smartsheet-project","format":"Rich","lastPost":{"discussionID":106883,"commentID":382423,"name":"Re: Needing some help with my current smartsheet project","url":"https:\/\/community.smartsheet.com\/discussion\/comment\/382423#Comment_382423","dateInserted":"2023-06-26T20:13:57+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-26T20:54:28+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-26T15:51:35+00:00","dateAnswered":"2023-06-26T15:23:39+00:00","acceptedAnswers":[{"commentID":382304,"body":"

@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":106901,"type":"question","name":"Can you use a COUNTIF formula to county symbols?","excerpt":"I have a list of goals for the year and we are using harvey ball symbols to indicate the percent complete an the red, yellow, green, gray balls to indicate the health\/status of the project. I would like to display a report on my dashboard that shows the number of projects we have in each harvey ball stage and also in each…","categoryID":322,"dateInserted":"2023-06-26T15:59:48+00:00","dateUpdated":"2023-06-26T16:00:12+00:00","dateLastComment":"2023-06-26T16:29:45+00:00","insertUserID":162764,"insertUser":{"userID":162764,"name":"Stephanie D","title":"Program Manager","url":"https:\/\/community.smartsheet.com\/profile\/Stephanie%20D","photoUrl":"https:\/\/aws.smartsheet.com\/storageProxy\/image\/images\/u!1!mctWfgWrL7o!n-DX3ymVfmQ!msa32mT4_k9","dateLastActive":"2023-06-26T16:52:22+00:00","banned":0,"punished":0,"private":false,"label":"✭"},"updateUserID":162764,"lastUserID":8888,"lastUser":{"userID":8888,"name":"Andrée Starå","title":"Smartsheet Expert Consultant & Partner | Workflow Consultant \/ CEO @ WORK BOLD","url":"https:\/\/community.smartsheet.com\/profile\/Andr%C3%A9e%20Star%C3%A5","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/userpics\/0PAU3GBYQLBT\/nXWM7QXGD6464.jpg","dateLastActive":"2023-06-26T23:47:23+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭✭✭"},"pinned":false,"pinLocation":null,"closed":false,"sink":false,"countComments":3,"countViews":26,"score":null,"hot":3375593973,"url":"https:\/\/community.smartsheet.com\/discussion\/106901\/can-you-use-a-countif-formula-to-county-symbols","canonicalUrl":"https:\/\/community.smartsheet.com\/discussion\/106901\/can-you-use-a-countif-formula-to-county-symbols","format":"Rich","tagIDs":[254],"lastPost":{"discussionID":106901,"commentID":382346,"name":"Re: Can you use a COUNTIF formula to county symbols?","url":"https:\/\/community.smartsheet.com\/discussion\/comment\/382346#Comment_382346","dateInserted":"2023-06-26T16:29:45+00:00","insertUserID":8888,"insertUser":{"userID":8888,"name":"Andrée Starå","title":"Smartsheet Expert Consultant & Partner | Workflow Consultant \/ CEO @ WORK BOLD","url":"https:\/\/community.smartsheet.com\/profile\/Andr%C3%A9e%20Star%C3%A5","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/userpics\/0PAU3GBYQLBT\/nXWM7QXGD6464.jpg","dateLastActive":"2023-06-26T23:47:23+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-26T16:24:48+00:00","dateAnswered":"2023-06-26T16:08:42+00:00","acceptedAnswers":[{"commentID":382328,"body":"

Hi @Stephanie D<\/a> <\/p>

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

Try something like this.<\/p>

=COUNTIF(Status:Status, \"Green\")<\/p>

=COUNTIF([% Complete]:[% Complete], \"Half\")<\/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>"}]}},"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