andmarti1424 / sc-im

sc-im - Spreadsheet Calculator Improvised -- An ncurses spreadsheet program for terminal
Other
4.77k stars 201 forks source link

`Pc` a range but keeping some references fixed #851

Closed Nora-n closed 10 months ago

Nora-n commented 10 months ago

I want to create a column H that is, for instance, 10G/(avg(G)). I can insert a column, then on the first row type `=11G1/@avg(G1:G40), copy that formula, visual-select the rowsH2:H40andPcsaid formula. But pasting that formula withPcchanges the range in the average: I get=11G2/@avg(G2:G41)etc, but I want to keep the average of the whole G column. The same thing happens if I have the average somewhere else and use that cell (for instance=11G1/G41whereG41has the value=@avg(G1:G40): pasting that will update the range forG1andG41`.

How to create a column based on another one?

Thanks!

Originally posted by @Nora-n in https://github.com/andmarti1424/sc-im/discussions/847

andmarti1424 commented 10 months ago

May be I dont get the problem correctly. If you want to keep the avg fixed, you can type 11*G1/@avg($G$1:$G $40), then you can copy and paste with Pc and G1 will get updated to reference G2, etc..

Nora-n commented 10 months ago

Wow that was an easy one, didn't find that in the help files. Wonderful! Thanks for the quick answer and for the tool, I'm loving it :-).