From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <emacs-orgmode-bounces+larch=yhetil.org@gnu.org>
Received: from mp10.migadu.com ([2001:41d0:303:e16b::])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	by ms8.migadu.com with LMTPS
	id ENpoAs00SWVK5gAAG6o9tA:P1
	(envelope-from <emacs-orgmode-bounces+larch=yhetil.org@gnu.org>)
	for <larch@yhetil.org>; Mon, 06 Nov 2023 19:47:41 +0100
Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	by mp10.migadu.com with LMTPS
	id ENpoAs00SWVK5gAAG6o9tA
	(envelope-from <emacs-orgmode-bounces+larch=yhetil.org@gnu.org>)
	for <larch@yhetil.org>; Mon, 06 Nov 2023 19:47:41 +0100
Received: from lists.gnu.org (lists.gnu.org [209.51.188.17])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by aspmx1.migadu.com (Postfix) with ESMTPS id A904C63A81
	for <larch@yhetil.org>; Mon,  6 Nov 2023 19:47:40 +0100 (CET)
Authentication-Results: aspmx1.migadu.com;
	dkim=pass header.d=gmail.com header.s=20230601 header.b=fdAmmzE6;
	spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org";
	dmarc=pass (policy=none) header.from=gmail.com
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org;
	s=key1; t=1699296460;
	h=from:from:sender:sender:reply-to:subject:subject:date:date:
	 message-id:message-id:to:to:cc:mime-version:mime-version:
	 content-type:content-type:in-reply-to:in-reply-to:
	 references:references:list-id:list-help:list-unsubscribe:
	 list-subscribe:list-post:dkim-signature;
	bh=IXCbiqOAu/oQBnD2iGik9mPBPzVrD8R2Co/TDqhynrc=;
	b=Xds4crvcYPMiw/Y7w2ggKIjgsOHKS2LtrNACbFeGS/IFNKb1rqPXq249hF7meP9zjpNLjX
	713iwW4q+fe2j4mSOyWr7ofQHyNRryavVTrK3jNISY+0BeLmgSxgvAQbFxEUEIqJVwdBPh
	u3J9qs675wI/gBJaov6UcbUsjgyWsp3BS/esPJ3HRBVyYqQ+NnoqmIkU/cjEd0VsPjW5wS
	2w54MPKwGwoJNs7SXpRvmzc4K7rr2X1jARJONhQZreg45RjwqT0u2DC/mm4f9YMHgINuht
	GsAkYSXMRMeCaHdLWKp2Te4f1vYGTiCQebV61DAfaVBMUkOqx18KvHHXxpAG+Q==
ARC-Authentication-Results: i=1;
	aspmx1.migadu.com;
	dkim=pass header.d=gmail.com header.s=20230601 header.b=fdAmmzE6;
	spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org";
	dmarc=pass (policy=none) header.from=gmail.com
ARC-Seal: i=1; s=key1; d=yhetil.org; t=1699296460; a=rsa-sha256; cv=none;
	b=Evlu1ybvJRTk5nmIb3d7s3Kw2LzGV5lj106fotCdYv8uktCI0mVJ3mCxjc1P6MMazokQwA
	qj1boYVAUl97yHHnl3uPAg4NxpLt30LS7fMb+1B2Vtq/1BgaA4k1PI/BPDr9vJR2FBL1qx
	lvF9QzkCwH41YVbErsHFTFbGW8ZsZBS0v1q+Lnu3hNgI9ELDh1nElLMum/ry8q/OopZ18J
	d37jdBap2W6HKz3GO2Pj5rxXhaa2YNq2UHvIuUoqyDEGzBLR8iif1emBmWK/V5cUAuTinN
	fxRcH73OLl8s6Bquqa/N6/w+D8jgr9EovXn4HIytf+mQrHf71zaylO973NQ7sg==
Received: from localhost ([::1] helo=lists1p.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.90_1)
	(envelope-from <emacs-orgmode-bounces@gnu.org>)
	id 1r04ch-0002tk-Uu; Mon, 06 Nov 2023 13:46:55 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <brubar.cs@gmail.com>)
 id 1r04ch-0002tc-4Y
 for emacs-orgmode@gnu.org; Mon, 06 Nov 2023 13:46:55 -0500
Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <brubar.cs@gmail.com>)
 id 1r04cf-0000GW-JF
 for emacs-orgmode@gnu.org; Mon, 06 Nov 2023 13:46:54 -0500
Received: by mail-wr1-x42c.google.com with SMTP id
 ffacd0b85a97d-32f7bd27c2aso3401545f8f.2
 for <emacs-orgmode@gnu.org>; Mon, 06 Nov 2023 10:46:52 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1699296411; x=1699901211; darn=gnu.org;
 h=mime-version:date:references:in-reply-to:subject:to:from:message-id
 :from:to:cc:subject:date:message-id:reply-to;
 bh=IXCbiqOAu/oQBnD2iGik9mPBPzVrD8R2Co/TDqhynrc=;
 b=fdAmmzE6OUGToGFRLdKfkhVBZIHAo10JM0ZUZyobnNNKU62Xlgbi1h+TL1AiK4zmOq
 504snB6330hT+fdS3aFBEAe6hXoLFV/JxRLIZFezSkzUYtwf6eg7mDlnJtB7FzKfdUXq
 aD2ieyIl0T2Ttm0o/1emi7b+ziG6Pa0xDt2uvRxfZHh98InB1vTz/bxEE+35YW3U2Mmx
 Y8/0fB7dcZMwsctUtxNP/H6L2UKv47MtFzYlidbL8LabIZKoHSNvZ2Xjxhn+6U1ttCGN
 83Espwb+6VWHtsQZarOYkAjn4EZLI8tIZMCliCuyNiJxzJaSVEiQM8xUYEoHN3lXCUId
 PsnA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1699296411; x=1699901211;
 h=mime-version:date:references:in-reply-to:subject:to:from:message-id
 :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
 bh=IXCbiqOAu/oQBnD2iGik9mPBPzVrD8R2Co/TDqhynrc=;
 b=EBqjMmGkbK4kIkb+RFVEtFfefVrGsMDFHccI9C6aAlz5kUiR6LAWFBc8qUabwW+gv1
 m7hy2ya+MFrjVsXe2QJwiZ3Fk6z8RtxZz66Lo2w42WANbjZgHWik+6FeRc6wagNuxIKG
 BzReaa6i/55uNFfMNeYgkGt2Yq3BVfWgZKeVrTktO6b5FZf8TT+qBCbAEilJNEu/bjCs
 CZXEFKwVP6Ssq/CLDRDtG83fuoXo235k9ZxkQmyEBvcC/6CPEQSsLzZ6ldpNFtS1To33
 9XTBrxx5K0hCPCTRQyJeIu3ufoFoDuePw90IyHn1KonVcp4aqPvcjCYq6U86Yj73hdD1
 5Vxg==
X-Gm-Message-State: AOJu0Yzi6YKbkJBYMQkq9O6+PyIsLPrv4/LzNb9paa2bjZSuyhrghu6G
 L8tKVvSFD3tVbUxFCUHOoeY=
X-Google-Smtp-Source: AGHT+IEoOiyYGBlZONJrHm749zWhjxXFENy/fD8dsSHbn9SOz6XT+6t6pgF73TdpC05gSYefcnRtXA==
X-Received: by 2002:adf:f212:0:b0:32d:6891:f819 with SMTP id
 p18-20020adff212000000b0032d6891f819mr21675939wro.41.1699296411236; 
 Mon, 06 Nov 2023 10:46:51 -0800 (PST)
Received: from keynux ([2a01:e0a:505:3460:1c18:688d:ece4:372e])
 by smtp.gmail.com with ESMTPSA id
 n7-20020a5d6607000000b0032db1d741a6sm288742wru.99.2023.11.06.10.46.49
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 06 Nov 2023 10:46:50 -0800 (PST)
Message-ID: <6549349a.5d0a0220.f89cb.1866@mx.google.com>
Received: by keynux (sSMTP sendmail emulation); Mon, 06 Nov 2023 19:46:49 +0100
From: Bruno Barbier <brubar.cs@gmail.com>
To: Uwe Brauer <oub@mat.ucm.es>, emacs-orgmode@gnu.org
Subject: Re: how to exclude certain row values from calculation in a table
In-Reply-To: <87sf5i3mob.fsf@mat.ucm.es>
References: <87sf5i3mob.fsf@mat.ucm.es>
Date: Mon, 06 Nov 2023 19:46:49 +0100
MIME-Version: 1.0
Content-Type: text/plain
Received-SPF: pass client-ip=2a00:1450:4864:20::42c;
 envelope-from=brubar.cs@gmail.com; helo=mail-wr1-x42c.google.com
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001,
 MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-BeenThere: emacs-orgmode@gnu.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: "General discussions about Org-mode." <emacs-orgmode.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/emacs-orgmode>,
 <mailto:emacs-orgmode-request@gnu.org?subject=unsubscribe>
List-Archive: <https://lists.gnu.org/archive/html/emacs-orgmode>
List-Post: <mailto:emacs-orgmode@gnu.org>
List-Help: <mailto:emacs-orgmode-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/emacs-orgmode>,
 <mailto:emacs-orgmode-request@gnu.org?subject=subscribe>
Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org
Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org
X-Migadu-Flow: FLOW_IN
X-Migadu-Country: US
X-Migadu-Spam-Score: -6.42
X-Spam-Score: -6.42
X-Migadu-Queue-Id: A904C63A81
X-Migadu-Scanner: mx13.migadu.com
X-TUID: xlHV5noRmisU


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