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 ✭✭✭✭✭✭
好的。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
Answers
-
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
-
EBooher ✭
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 ✭✭✭✭✭✭
-
EBooher ✭
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 ✭✭✭✭✭✭
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
-
EBooher ✭
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 ✭✭✭✭✭✭
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
-
EBooher ✭
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.
-
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:
"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
-
EBooher ✭
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
.
-
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
-
EBooher ✭
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 ✭✭✭✭✭✭
好的。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
-
EBooher ✭
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 ✭✭✭✭✭✭
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
Categories
Check out theFormula Handbook template!
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"}]},{"discussionID":106897,"type":"question","name":"Delinquency Report","excerpt":"Hi SmartSheet Community, How do you pull a delinquency report showing month to month stagnation, in the same column across sheets? I'd like to send a monthly update request form for the \"assign to\" with their lists and pull only those item's whose %complete hasn't been updated in the last 30days. Is there a column specific…","categoryID":322,"dateInserted":"2023-06-26T15:35:15+00:00","dateUpdated":null,"dateLastComment":"2023-06-26T16:23:29+00:00","insertUserID":162550,"insertUser":{"userID":162550,"name":"Avani","title":"Senior Manager, PMO","url":"https:\/\/community.smartsheet.com\/profile\/Avani","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2023-06-26T18:44:26+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-26T16:21:56+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭✭✭"},"pinned":false,"pinLocation":null,"closed":false,"sink":false,"countComments":1,"countViews":19,"score":null,"hot":3375590924,"url":"https:\/\/community.smartsheet.com\/discussion\/106897\/delinquency-report","canonicalUrl":"https:\/\/community.smartsheet.com\/discussion\/106897\/delinquency-report","format":"Rich","lastPost":{"discussionID":106897,"commentID":382339,"name":"Re: Delinquency Report","url":"https:\/\/community.smartsheet.com\/discussion\/comment\/382339#Comment_382339","dateInserted":"2023-06-26T16:23:29+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-26T16:21:56+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:27:10+00:00","dateAnswered":"2023-06-26T16:23:29+00:00","acceptedAnswers":[{"commentID":382339,"body":" You would need to use a Record A Date automation to grab the date the % Complete column was last updated.<\/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-26T16:35:15+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-26T17:07:56+00:00","banned":0,"punished":0,"private":false,"label":"✭"},"updateUserID":null,"lastUserID":162756,"lastUser":{"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-26T17:07:56+00:00","banned":0,"punished":0,"private":false,"label":"✭"},"pinned":false,"pinLocation":null,"closed":false,"sink":false,"countComments":7,"countViews":39,"score":null,"hot":3375588344,"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":382348,"name":"Re: Needing some help with my current smartsheet project","url":"https:\/\/community.smartsheet.com\/discussion\/comment\/382348#Comment_382348","dateInserted":"2023-06-26T16:35:15+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-26T17:07:56+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":"