• Resolved racingvalue

    (@racingvalue)


    Hi,

    Great plugin!

    I am trying to use the AUTOSUM using something like =SUM(A2:A8) and have managed to get it to work but the end result is not adding the decimal as you can see in the pics, how would i go about getting the result from lets say 4 to 4.00?


    • This topic was modified 7 years, 10 months ago by racingvalue.
    • This topic was modified 7 years, 10 months ago by racingvalue.
Viewing 13 replies - 1 through 13 (of 13 total)
  • Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    thanks for your post, and sorry for the trouble.

    For this, just wrap your SUM equation in a NUMBER_FORMAT call:
    =NUMBER_FORMAT( SUM( G2:G4 ), 2 )

    Regards,
    Tobias

    Thread Starter racingvalue

    (@racingvalue)

    Perfect!

    Just one more thing is there any way to autosum say column G automatically when a new row is added from G2 onwards instead of editing the “=NUMBER_FORMAT( SUM( G2:G4 ), 2 )” each time?

    Thanks ??

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    if you use the “Insert row” button (when a row in the range of G2 to G4 is checked, by marking its checkbox on the left), the range should automatically expand.

    Regards,
    Tobias

    Thread Starter racingvalue

    (@racingvalue)

    Great thanks very much.

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    no problem, you are very welcome! ?? Good to hear that this helped!

    Best wishes,
    Tobias

    P.S.: In case you haven’t, please rate TablePress here in the plugin directory. Thanks!

    Thread Starter racingvalue

    (@racingvalue)

    Hi Tobias,

    I am just wondering is it possible to SUM just the visible rows which have been filtered.

    I get this error:

    !ERROR! CIRCLE REFERENCE

    Thanks

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    not really, I’m afraid. As you can see, you get a circle reference, which means that the cell with the formula is part of the cells that are to be summed up.

    Regards,
    Tobias

    Hi,
    if you want to use SUM just the visible rows which have been filtered, it necessary to add a Table Footer
    You should add a new row to the end of the table and click the “Table Footer” row as well.
    and you can see
    Sum of column

    Best regards
    Eric

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi Eric,

    yes, that would also be a nice solution.

    Regards,
    Tobias

    Thread Starter racingvalue

    (@racingvalue)

    Thanks for the reply guys.

    Hi ericc44, I have added the footer and added this code but still see the !ERROR! Circle Reference, is this correct or did i miss something?

    “footerCallback”: function( row, data, start, end, display ) { var api = this.api(), data; var intVal = function ( i ) { return typeof i === ‘string’ ? i.replace(/[\$,]/g, ”)*1 : typeof i === ‘number’ ? i : 0; }; total = api .column( 1, { page: ‘current’} ) .data() .reduce( function (a, b) { return intVal(a) + intVal(b); }, 0 ); $( api.column(1 ).footer() ).html( total ); $( api.column( 2 ).footer() ).html(‘Totals :’); }

    Thanks

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    as this JavaScript “Custom Command” is a replacement for the formulas on the “Edit” screen, you must also remove those. This basically shifts the calculation from the server side to the browser.

    Regards,
    Tobias

    Hi,
    Thanks Tobias it is true.

    Note : first column number is 0
    This code is correct and should sum all column 1 (column number 2 of your table) and add text ‘Totals :’ in your column 2 (column number 3 of your table).
    Can you check you have only number in column 1 ?

    Can you put a table link to check, please.

    Best regards
    Eric

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    yes, a link to check would be great, if you can’t solve this.

    Regards,
    Tobias

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘AUTOSUM’ is closed to new replies.