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: Uwe Brauer
Subject: Re: how to exclude certain row values from calculation in a table
Date: Mon, 06 Nov 2023 20:58:28 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

Hi Bruno


> Hi Uwe,

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

> ...

> 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!"))

Very cool, thank you very much indeed, this is very helpful

Uwe 




-- 
I strongly condemn Hamas heinous atrocities on Israel, especially the 
despicable pogroms.
I strongly condemn Putin's war of aggression against Ukraine.
I support to deliver weapons to Ukraine's military. 
I support the NATO membership of Ukraine.
I support the EU membership of Ukraine. 
https://addons.thunderbird.net/en-US/thunderbird/addon/gmail-conversation-view/

Attachment: smime.p7s
Description: S/MIME cryptographic signature


reply via email to

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