%%HP: T(3); @ Ascii translation: \GS = Sigma, \-> = RightArrow
DIR @ World's Tiniest Spreadsheet (G/GX only), (c) 1996 by John H Meyers
  SUM @ Append column and/or row sums to a matrix or vector (133 bytes)
    \<< DUP SIZE DUP SIZE GET 1 > @ Row sums
        { \->COL \->LIST DUP \GSLIST + OBJ\-> COL\-> } IFT
        DUP SIZE DUP SIZE 1 > SWAP 1 GET 1 > AND @ Column sums
        { \->ROW \->LIST DUP \GSLIST + OBJ\-> ROW\-> } IFT \>>
  CUT @ Remove sums created by SUM (103 bytes)
    \<< DUP SIZE SIZE 1 > @ Column sums
        { DUP SIZE OBJ\-> ROT 1 - 1 MAX ROT ROT \->LIST RDM } IFT
        DUP SIZE DUP SIZE GET DUP 1 > { COL- } IFT DROP \>> @ Row sums
END @ 242.5 bytes (on stack), #A07Bh checksum