Can I change the column summary to row summary like the picture below?
By the way, I don’t want to use formulas.
Column summary to row summary
Hi @curlydoggi
row summary is not yet implemented. And if you do not want to use formulas, you can also use native JS (Math
, reduce()
) using the getDataAtRow()
method.
The destination option solved showing the results of the col summary in the last column on the right. However, there is no source row option, so it cannot be made like the picture above.
You told me to use native JS (Math, redox()) using getDataAtRow() method, but I don’t know exactly what it means. Can I ask for a demo?
f you do not want to use predefined formulas (from our plugin) then you would need to use native JS options, like reduce()
.
Here are some related topics
- How to sum values https://stackoverflow.com/questions/1230233/how-to-find-the-sum-of-an-array-of-numbers
-
Average
is just the one above with the division to whatever you received should look likevalue_from sum / number_of_elements
andnumer_of_elements
can be checked viahot.countCols()
- this method gives you a number of columns in the table - Max - can be checked via
Math.max
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/max - Mix - can be checked via
Math.min
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/min - Count - here you’d need to create a bit more logic if you’d want to skip formulas but still have the same logic as https://support.microsoft.com/en-us/office/count-function-a59cd7fc-b623-4d93-87a4-d23bf411294c?ranMID=46131&ranEAID=a1LgFw09t88&ranSiteID=a1LgFw09t88-SJD4u9gqARdvkJgsHBDcUQ&epi=a1LgFw09t88-SJD4u9gqARdvkJgsHBDcUQ&irgwc=1&OCID=AID2200057_aff_7806_1243925&tduid=(ir__dxky9zh1tkkf6whl2qniaboutn2xv92l0f9rjwm900)(7806)(1243925)(a1LgFw09t88-SJD4u9gqARdvkJgsHBDcUQ)()&irclickid=_dxky9zh1tkkf6whl2qniaboutn2xv92l0f9rjwm900
And here’s a demo I made some time ago, it should help you to specify how to use those functions https://jsfiddle.net/AMBudnik/rosf7ep8/
Thank you so much for posting the demo
I am writing code while checking your demo, but I applied it and wrote my own sum of row code, is there a way to know which is better in performance when comparing your code with mine?
https://jsfiddle.net/jwd1choe/8/
For example, when we talk about performance when the amount of cells increased or the number of rows in the table increased
I do not think that we have tests for that as it is not a part of any plugin or core method You can try to create a huge array and populate the reduce
in the total column to check how it would work.