Welcome to the Smartsheet Forum Archives


The posts in this forum are no longer monitored for accuracy and their content may no longer be current. If there's a discussion here that interests you and you'd like to find (or create) a more current version, pleaseVisit the Current Forums.

Sum formula Error When References Results from IF Formula

Gladys Liley
Gladys Liley ✭✭✭✭✭
edited 12/09/19 inArchived 2017 Posts

I am getting an #Invalid Operation error when my Sum formula references a cell with results from an IF formula:

=SUM([Column 8]1 * [Column 9]1) results as #Invalid Operation error

Column 9 formula

=IF([Column 2] = "A", "0.5%", IF([Column 2] = "B", "1.5%"))

I've tried to fix by using a nested VALUE= but that does not work either. Is there anything I can do to fix it?

Thank you greatly for any help.

Gladys

Comments

  • Mike Wilday
    Mike Wilday ✭✭✭✭✭✭

    Hi, Gladys, based on the asterisk in your formula it appears that you are trying to multiply the two fields together. You should be able to accomplish what you are looking to do using either of these formulas:

    =[Column8]1 * [Column9]1

    If you're looking to add them together use this formula,

    =SUM([Column 8]1, [Column 9]1)

    Here is more information about the sum formula:https://help.smartsheet.com/function/sum

  • J. Craig Williams
    J. Craig Williams ✭✭✭✭✭✭

    Gladys,

    Mike is correct (I believe). The #INVALID OPERATION is due to the multiplication.

    In addition

    VALUE("1.5%") will return #INVALID VALUE

    The VALUE() function will return the numeric value of text IF IT CAN. But since % is not a number, it can not in this case.

    For your formula in column 9, return the number and then format it for percentage (you may need to add a decimal to the standard percentage format)

    =IF([Column 2] = "A", 0.005, IF([Column 2] = "B", 0.015))

    For follow on formulas, be aware that 1% is 0.01 value.

    Lastly, if you are trying to perform a SUMPRODUCT type function, see this post:

    https://community.smartsheet.com/discussion/weighted-average-sumproduct

    I hope this helps.

    Craig

  • Gladys Liley
    Gladys Liley ✭✭✭✭✭

    Craig & Mike,

    It worked!

    I removed the SUM from the formula, removed the parenthesis ("") from the Column 9 formula around the % value and changed the column type to %...wallla. You guys are best!

    Thank you again!

  • J. Craig Williams
    J. Craig Williams ✭✭✭✭✭✭

    You are welcome.

    Craig

  • Gladys,

    Good catch Mike and Craig, sometimes it's hard to see the obvious.

    I would offer a friendly suggestion with the IF formula as you are using it ...

    End the formula with instructions if the entry in column 2 is not A or B. Below I added a dash in parenthesis, or you could use "error", or "Enter A or B in Column 2", or any other message. Having the formula put something in the cell and not just let it be blank helps to not mistake the cell as a blank cell and accidentally overwriting the formula.

    I was actually surprised to see that the IF formula worked without this final instruction.

    =IF([Column 2] = "A", 0.005, IF([Column 2] = "B", 0.015,"-"))

    Have fun.

    丹•戴维斯

  • J. Craig Williams
    J. Craig Williams ✭✭✭✭✭✭

    Good point Dan.

    Every such decision must be weighed against the in-system design.

    For example, if [Column 2] is a drop down list, then an error is on the input, not the output, so I would do something else to find and fix that (the recent data validation changes for example)

    As the original post says, there was a formula somewhere that was summing the results column. That means blank or "-" would be OK, but something else like

    =条件统计(结果:结果,值(@cell)> 0)

    would toss an error.

    Also, because of the SUM() after, the flag for missed entry might be overlooked as it is one step removed from the cause.

    There are plenty of guidelines but fewer hard and fast rules.

    When answering questions, I try to focus on the requirements, sometimes asking questions if a requirement seems to be missing.

    Craig

  • Mike Wilday
    Mike Wilday ✭✭✭✭✭✭

    Good point Craig. I agree with your statement about trying to focus on the requirements. Sometimes that's all that's needed. Sometimes the output then reveals further questions. I tend to address those when they come up, unless there are clear signs of other issues that could arise - then I bring attention to those right away.

This discussion has been closed.
You will need to insert a text\/number column and use<\/p>

=[Modified Date]@orw + \"\"<\/p>

plus quote quote<\/p>


<\/p>

To turn it into a text value. You would then use a copy row automation set to trigger at whatever point you want to capture this. It will then be static data in the second sheet where you can use a formula with cross sheet references to pull the static date\/time stamp back over into your working sheet.<\/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":111765,"type":"question","name":"Auto Populate field based on selection","excerpt":"Good morning everyone! i am hoping you can please assist me. I am trying to create a form that if a person selects a name their position auto populates. Can anyone help me with this? Peppey","snippet":"Good morning everyone! i am hoping you can please assist me. I am trying to create a form that if a person selects a name their position auto populates. Can anyone help me with…","categoryID":322,"dateInserted":"2023-10-17T13:45:28+00:00","dateUpdated":null,"dateLastComment":"2023-10-18T13:25:11+00:00","insertUserID":140527,"insertUser":{"userID":140527,"name":"Peppey","url":"https:\/\/community.smartsheet.com\/profile\/Peppey","photoUrl":"https:\/\/aws.smartsheet.com\/storageProxy\/image\/images\/u!1!02teP5bBevo!071fv8KxR-Q!0yzavIVx10P","dateLastActive":"2023-10-18T13:30:09+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-18T13:41:13+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭✭✭"},"pinned":false,"pinLocation":null,"closed":false,"sink":false,"countComments":6,"countViews":31,"score":null,"hot":3395189439,"url":"https:\/\/community.smartsheet.com\/discussion\/111765\/auto-populate-field-based-on-selection","canonicalUrl":"https:\/\/community.smartsheet.com\/discussion\/111765\/auto-populate-field-based-on-selection","format":"Rich","tagIDs":[204,254],"lastPost":{"discussionID":111765,"commentID":400522,"name":"Re: Auto Populate field based on selection","url":"https:\/\/community.smartsheet.com\/discussion\/comment\/400522#Comment_400522","dateInserted":"2023-10-18T13:25:11+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-18T13:41:13+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-10-18T13:30:14+00:00","dateAnswered":"2023-10-18T13:25:11+00:00","acceptedAnswers":[{"commentID":400522,"body":"

Happy to help. 👍️<\/span><\/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":204,"urlcode":"forms","name":"Forms"},{"tagID":254,"urlcode":"formulas","name":"Formulas"}]},{"discussionID":111748,"type":"question","name":"IF CONTAINS and Concatenation returning a Zero for Some Multi Select Options","excerpt":"I have a multi select column for event type and I want a concatenation based on the selection. The below works for the first two instances but then adds a zero in before the rest. Is there a way I can rewrite it so that the zero doesn't appear? =IF(CONTAINS([EVENT CATEGORY]@row, \"Breakfast\"), [EVENT CATEGORY]@row + \"_\" +…","snippet":"I have a multi select column for event type and I want a concatenation based on the selection. The below works for the first two instances but then adds a zero in before the rest.…","categoryID":322,"dateInserted":"2023-10-17T08:24:05+00:00","dateUpdated":null,"dateLastComment":"2023-10-18T13:10:13+00:00","insertUserID":163620,"insertUser":{"userID":163620,"name":"Samantha McDonald","url":"https:\/\/community.smartsheet.com\/profile\/Samantha%20McDonald","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/userpics\/ZFVPD60OP4W3\/nXR74LCJYSLI1.jpg","dateLastActive":"2023-10-18T08:59:02+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-18T13:41:13+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭✭✭"},"pinned":false,"pinLocation":null,"closed":false,"sink":false,"countComments":3,"countViews":25,"score":null,"hot":3395167458,"url":"https:\/\/community.smartsheet.com\/discussion\/111748\/if-contains-and-concatenation-returning-a-zero-for-some-multi-select-options","canonicalUrl":"https:\/\/community.smartsheet.com\/discussion\/111748\/if-contains-and-concatenation-returning-a-zero-for-some-multi-select-options","format":"Rich","lastPost":{"discussionID":111748,"commentID":400508,"name":"Re: IF CONTAINS and Concatenation returning a Zero for Some Multi Select Options","url":"https:\/\/community.smartsheet.com\/discussion\/comment\/400508#Comment_400508","dateInserted":"2023-10-18T13:10:13+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-18T13:41:13+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-10-18T08:58:59+00:00","dateAnswered":"2023-10-17T13:36:26+00:00","acceptedAnswers":[{"commentID":400331,"body":"

You need to output a \"blank\" in the third portion of each IF statement.<\/p>

=IF(CONTAINS(.......), ......., \"\")<\/strong> + .......<\/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&includeChildCategories=1&type%5B0%5D=Question&excludeHiddenCategories=1&siteSectionID=0&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 Posts","subtitle":null,"description":null,"noCheckboxes":true,"containerOptions":[],"discussionOptions":[]}">

Trending Posts