emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: how to exclude certain row values from calculation in a table


From: Bruno Barbier
Subject: Re: how to exclude certain row values from calculation in a table
Date: Mon, 06 Nov 2023 19:46:49 +0100

Hi Uwe,

Uwe Brauer <oub@mat.ucm.es> writes:

> Hi all
>
> Please look at 
>
> |   |  Price |
> |---+--------|
> | / |  10.98 |
> |   |  11.90 |
> |   |  19.98 |
> |   |  13.79 |
> |   |  29.97 |
> |   |  18.98 |
> |   |  13.79 |
> |   |  11.90 |
> |   |  24.28 |
> |---+--------|
> |   | 155.57 |
> #+TBLFM: @11$2=vsum(@I$2..@II$2);f2
>
> I would like to exclude the first value from the sum by adding some mark
> in that row.
...
>
> Any idea how to exclude row values in a column?

You could use 'vmask' to mask the values you don't want.
Here is an example using vmask:

   |                |  Price |
   |----------------+--------|
   | 1              |  10.98 |
   |                |  11.90 |
   |                |  19.98 |
   |                |  13.79 |
   | 1              |  29.97 |
   |                |  18.98 |
   |                |  13.79 |
   |                |  11.90 |
   |                |  24.28 |
   |----------------+--------|
   |                | 155.57 |
   | Total unmarked | 114.62 |
   | Total marked   |  40.95 |
   | Check all      |     OK |
   #+TBLFM: @11$2=vsum(@I$2..@II$2);f2
   #+TBLFM: @12$2=vsum(vmask(map(<0 = #1>, @I$1..@II$1), @I$2..@II$2));f2NE
   #+TBLFM: @13$2=vsum(vmask(map(<1 = #1>, @I$1..@II$1), @I$2..@II$2));f2NE
   #+TBLFM: @14$2=string(if(@12$2+@13$2 = @11$2, "OK", "Oops!"))

Bruno




reply via email to

[Prev in Thread] Current Thread [Next in Thread]