A Tiny SHEET (using a 9 x 20 grid of Formulas)

I needed a simple no-frills spreadsheet-like page for a client project.
So I built the following and decided to publish it so that others can use it as they want.
You must open it in Coda to see it properly.

Each ‘cell’ is a formula, labeled A 1 thru I 20 (sorry but coda puts a space between the letter and the number).
Thus, when you click on a cell, you edit the formula. Move up one line to the 0 and replace it.

You then replace it with a number or an entire formula. The formula can refer to other Tables & Columns in the same doc.

In the formula you refer to other cells using the A 1I 20 labels.

I could only fit 9 columns across with a 9-digit result. But you can change that.
The formula N at the bottom of the page defines the width of all the cells.
And you can add more rows if you need them by copy/pasting the last row.

Each cell uses the LeftPad() and the Left() functions to keep a constant cell width for all results.

enjoy,
Max

10 Likes

Oh my god… :no_mouth:

Why spaces between the letter and the number though?

Very cool exhibition of what you can do with Coda. I can’t wait for them to release indent() and better formatting tools! Great job @Xyzor_Max

1 Like

@Paul_Danyliuk

you can get rid of those spaces.
just click on EVERY cell and then click on the label, and then edit out the space.
for ALL 9*20 calls ie; 180 of them!

i made the fist formula and called it A
i then copy/pasted it across the first row
then i relabeled the 8 new formulas B through I (one by one)

then i copy/pasted the whole row 19 times
that gave me formulas called “A 2” to “I 20” (coda puts in the space when you copy a formula
i then renamed the top row of formulas to “A 1” thru “I 1” to maintain a consistent numbering

some day when i have some time to kill, i might go through all 180 cells and remove the spaces.

maybe somebody can think of a way to do it programmatically?

anyway - thats why there are spaces in the labels for now

max

ok, im new to sharing documents or templates…

whenever anyone tries-out my Tiny Sheet document, they are editing the original document!

how do i prevent that and make sure they COPY the document first and then use it?

max

You can share it in “play mode” :blush:

In the Share menu, just select Can view :point_down:

And then, go to Embed and check if Enable Play is toggled On :blush: .
This will allow others to literally play with your doc but their actions won’t be saved :blush: .

All, you would need to do then is to click on Copy Embed and paste it in your post/topic :blush: .

Hope this helps :blush:

Pretty cool doc by the way :raised_hands: :grin: !
(I’ll take a better look at it when I have a little bit more time :blush: )

4 Likes

@Pch , thanks for that – so THATS what Play Mode is!
Makes sense - duh!

Max

3 Likes

No problemo @Xyzor_Max :wink: !

I know I can — I was wondering why you had the spaces in the first place
(also had to add something to my comment so that it was 20 characters long, lol)

I’m actually thinking of a different way to implement this — with a table grouped in top and left, and a button that would recalculate everything, including entered formulas. The challenge then would be figuring out the dependency graph, i.e. in which order to recalculate formulas so that the sheet balances itself. Could be good content for Patreon though (which I recently reformed, by the way — hint hint :slight_smile: )

@Paul_Danyliuk

As I said earlier, the spaces are put there by Coda when I copy and paste the rows of formulas.
It adds a space and a number to the end of a label if it already exists. So I am stuck with ‘D 12’ type labels.

I looked at your document that inserts an equation into an action using _Merge() & _Deref_Object().
I was hoping to be able to use that to convert text into formulas. But it wont work with references (by name) to columns or named canvas formulas, alas.

For now, it does what the client needs it to do. In fact they actually need way fewer cells, so I am making it smaller.

Respect,
Max

1 Like

Ah sorry, missed it about the formulas copying and Coda adding the number.

Great to know it does what it needs to do for the client — I was mostly thinking of it as an explorative exercise.

TinySHEET wont work on MOBILE because you cannot edit the FORMULAS on mobile!

So I have built MicroSHEET below, which DOES work on the mobile platform.
It uses the @Paul_Danyliuk formula insertion hack (thanks Paul !)

I am working on improving the PERFORMANCE and fixing a bug.
Then I will do a version where you can change the labels to any name you want.

Max

1 Like

in order to improve performance of MicroSHEET, i need to know if there is a significant difference between ModifyRows() and SetControlValue.

im hoping to find that SetControlValue() is much faster because it does not involve a round-trip to the Coda servers, whereas ModifyRows() probably does (even if its using thisRow) ???

i seem to recall @Paul_Danyliuk mentioning something about this in a previous post, but cant find it.

respect
max

It should make no difference really. Table cells will be easier to reference. In both cases (be it a cell edit or a control edit) the value is updated on the client immediately, and then gets sent to the server. The round trip I was talking about concerned the Row ID that got assigned on the server and only then displayed to the user after the row had been saved to the snapshot.

Each control is technically a table anyway. So yeah, no difference in terms of perf, theoretically.

2 Likes

i tested the relative performance of the two methods of updating objects in Coda.
the C.SetControlValue(C+1) and the myTable.ModifyRows(N,N+1) formulas
by running a loop using each one for 2000 iterations.

the ModifyRows() function runs about 20% faster. this may be due to the fact that the control object C is a text string, so each update involves converting the expression result into a string.

respect
max

3 Likes