Re: [Orgmode] Spreadsheet and weighted means

2008-10-04 Thread Nicolas Goaziou
Hello, Carsten Dominik <[EMAIL PROTECTED]> writes: > (defun my-wmean (values weights) > (let ((vsum 0) (wsum 0)) >(while (and values weights) > (setq v (pop values) w (pop weights)) > (unless (equal "" v) > (setq vsum (+ vsum (* (string-to-number w) (string-to-number > v))) >

Re: [Orgmode] Spreadsheet and weighted means

2008-10-01 Thread Carsten Dominik
Hi Nicolas, On Oct 1, 2008, at 6:46 PM, Nicolas Goaziou wrote: Carsten Dominik <[EMAIL PROTECTED]> writes: Hello, Hi Nicolas, there s no builtin way to deal with this, in particular with the fact that you want to treat empty fields as non-existing, and therefore also to ignore the corresp

Re: [Orgmode] Spreadsheet and weighted means

2008-10-01 Thread Nicolas Goaziou
Carsten Dominik <[EMAIL PROTECTED]> writes: Hello, > Hi Nicolas, there s no builtin way to deal with this, in particular > with the fact that you want to treat empty fields as non-existing, and > therefore also to ignore the corresponding weight. > > You cou write a Lisp function to do this, thou

Re: [Orgmode] Spreadsheet and weighted means

2008-09-29 Thread Carsten Dominik
On Sep 20, 2008, at 9:00 AM, Nicolas Goaziou wrote: Hello, I stumbled upon this problem : I'd like to compute the weighted mean of some values, even though cells might be empty. In fact, I'm aiming at something like this : | | Coeff. |0.2 |0.5 | 1 | |---+

Re: [Orgmode] Spreadsheet and weighted means

2008-09-29 Thread Carsten Dominik
On Sep 29, 2008, at 10:43 AM, Carsten Dominik wrote: On Sep 20, 2008, at 9:00 AM, Nicolas Goaziou wrote: Hello, I stumbled upon this problem : I'd like to compute the weighted mean of some values, even though cells might be empty. In fact, I'm aiming at something like this : |

[Orgmode] Spreadsheet and weighted means

2008-09-20 Thread Nicolas Goaziou
Hello, I stumbled upon this problem : I'd like to compute the weighted mean of some values, even though cells might be empty. In fact, I'm aiming at something like this : | | Coeff. |0.2 |0.5 | 1 | |---++++| | Name | Mean | Tes