From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:306:2d92::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id iPlQDx7jImUnygAA9RJhRA:P1 (envelope-from ) for ; Sun, 08 Oct 2023 19:13:02 +0200 Received: from aspmx1.migadu.com ([2001:41d0:306:2d92::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id iPlQDx7jImUnygAA9RJhRA (envelope-from ) for ; Sun, 08 Oct 2023 19:13:02 +0200 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 E1CDB5B36E for ; Sun, 8 Oct 2023 19:13:01 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=N0Jov8gs; dmarc=pass (policy=none) header.from=gmail.com; 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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1696785182; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=Gojpu8wiLwAAhrHTMDZkmwm69M8jcOeZSCf02Z0p5vo=; b=hozTQNSWDxkoBCKK3QfTR7KEyV7FvAzinOBQLr9nPptzzxMQlOSHoBMXOo4++Nmp+bDYac STBULqtdeEFL2pvD36+gV8L/9MUv/qMmsP9+9VgqicHtmRZUHuVerG1KSLSIeCUv1yHNnl jbrQMB8tQkHApZ1eyDW3AX9l106zsa9I2M9tFWtcDLE8rcX2RL7JIXncay1U2Ucwa7EytZ goyDUDVBJ6EkBzmnJTqgTvSLajD5TWv+7K+mkfjeLths8UbD5VlKBpdhPvxfWwSFz+biBH w/J6qB3uuvnKpWNjiM8saJhyxPQuGc0NxRZ+um99W8eKjOAAKZD//hxF16GY7g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=N0Jov8gs; dmarc=pass (policy=none) header.from=gmail.com; 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" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1696785182; a=rsa-sha256; cv=none; b=KZwDluHVY10GOHSLGgp74bMvSsDuIma5JhR6zu61Hr64YE9ke3IHjA3TifaT1lJwll5r5l zuyc2sKntZrLdqqU67NS2R3kQdunUudk5WMQH1tlALGQ5JBeIzFEjF4oVkRPzVaPSBcLpN 1z5lwiY36XXWT9MjfJBSzYXcI3UOXULMnqImyCnuRTZoq4zkj9UP7v8571VcmjYcmRFVCE EbXMcF7Xguk/lXWBPB2LrS9Vz52syOC/6nKYzfAQ7AA/2h/fnWlUm7S/uax/KKbgMgJAdw 92tVye4mdSEa3n0g1j4wbS7l+ccgc2hxThmGnJwY9Mc2OxgXJOHhR7GysYifbg== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qpXJv-00020z-3E; Sun, 08 Oct 2023 13:11:59 -0400 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 ) id 1qpXJs-00020M-Tv for emacs-orgmode@gnu.org; Sun, 08 Oct 2023 13:11:56 -0400 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qpXJr-0007l2-8M for emacs-orgmode@gnu.org; Sun, 08 Oct 2023 13:11:56 -0400 Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-3232be274a0so2900134f8f.1 for ; Sun, 08 Oct 2023 10:11:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696785114; x=1697389914; darn=gnu.org; h=mime-version:date:references:in-reply-to:subject:cc:to:from :message-id:from:to:cc:subject:date:message-id:reply-to; bh=Gojpu8wiLwAAhrHTMDZkmwm69M8jcOeZSCf02Z0p5vo=; b=N0Jov8gsmqCmddgGnyWbTnS2WRyJgLd4G9QfLAZZEkEUnklI4/hFjmVA5HfoEtnfz8 j2f0EXJf9/I+LEXWKAc73QZzfuls6cr1r2fDUL1GwoGIIplcfiMTUClP5juguIPx/bNs i+WWB7rv4Q/7GAcRJZOw7unW2Z6RxLk7t6lB33SX2Z0l7vaANiHdV+ndrvEEdB2bTIHE Aka1iiLWEDQ8YS6cgL5BCu5/gO7b3OqIdJsjLGJ+GgXpVZL3u2ziIzbBmX9PTyeVhWW6 I7JwBqQkBGAdi78wyqAGo2ZTOh8TSG4eUlp3q2PDSsp3LxRgKkrwIMxLl3yIkiyZV6gb BXlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696785114; x=1697389914; h=mime-version:date:references:in-reply-to:subject:cc:to:from :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Gojpu8wiLwAAhrHTMDZkmwm69M8jcOeZSCf02Z0p5vo=; b=fjr7skB5nxV3RdPZscULCqOz4RQ1sNChEm2IKf4CLmtde9DPnhwwM72gzAt4duwKRQ uhPW5+RjmkR6W5v5dRWbynL90s+G7ufKsDbPkrmyfc5aWU1ewsJw2DwnyW8DPpm/cHX0 I+3CXOml0VBCEMUnv6Nh8OdE+Bj+Q/3SQpdbhC8vHXwsMW7FKsaiBsdxLiSGpWKBGJN/ 9AI4N1coWkAePD0BMQc+Rb4r0mXlQ2FZmP35RX7A7uQ6Qt3QXsgbHt7pYobncGouSkc8 TkIxg/BvuBqwlbXiGCKdXF8u685AkjPm7Q9vbzmfJyVgzHP2A40iEkBBfJQ4KTxOrOL/ CYyw== X-Gm-Message-State: AOJu0YwQPYj3U6eQNPl4CmuZX876m2rpgA2xXRL1nl0aUxpWx0uM0lll 21nxqkUBIh2hMhT+twYcxtU= X-Google-Smtp-Source: AGHT+IFMH8RknYoodrCa8L5duTM9wRdFt15iyWSswSTdYyWZrK1OHsrfA9G2HeEMN5zMSghC+FiRzA== X-Received: by 2002:a5d:595d:0:b0:31a:cca0:2f3a with SMTP id e29-20020a5d595d000000b0031acca02f3amr8258461wri.0.1696785113546; Sun, 08 Oct 2023 10:11:53 -0700 (PDT) Received: from keynux ([2a01:e0a:505:3460:169:7511:f49a:58eb]) by smtp.gmail.com with ESMTPSA id l14-20020adfe9ce000000b003143cb109d5sm7281036wrn.14.2023.10.08.10.11.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 Oct 2023 10:11:53 -0700 (PDT) Message-ID: <6522e2d9.df0a0220.75981.d798@mx.google.com> Received: by keynux (sSMTP sendmail emulation); Sun, 08 Oct 2023 19:11:51 +0200 From: Bruno Barbier To: Uwe Brauer Cc: Uwe Brauer , emacs-orgmode@gnu.org Subject: Re: equivalent of VLOOKUP (in ods) to org-table In-Reply-To: <871qe5hxed.fsf@mat.ucm.es> References: <87h6n1i84d.fsf@mat.ucm.es> <6522dbff.df0a0220.53465.d25c@mx.google.com> <871qe5hxed.fsf@mat.ucm.es> Date: Sun, 08 Oct 2023 19:11:51 +0200 MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2a00:1450:4864:20::42e; envelope-from=brubar.cs@gmail.com; helo=mail-wr1-x42e.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 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." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-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: -5.00 X-Spam-Score: -5.00 X-Migadu-Queue-Id: E1CDB5B36E X-Migadu-Scanner: mx2.migadu.com X-TUID: eo/q+EIYbgo3 Uwe Brauer writes: >>>> "BB" == Bruno Barbier writes: >> Did you check these lookup functions in the Org manual? >> (info "(org) Lookup functions") > > > Yes of course, but I am unable to obtain the same result as I do using > the remote call. Did you try something like this ? #+NAME: table1 | Name | Ex1 | Ex2 | Ex2 | Ex4 | Ex5 | ResSh1 | |--------+-----+-----+-----+-----+-----+--------| | Smith | 2 | 3 | 4 | 6 | 7 | 22 | | Miller | 2 | 10 | 1 | 1 | 5 | 19 | | Wick | 1 | 2 | 3 | 10 | 2 | 18 | #+TBLFM: $7=vsum($2..$6);f2 #+NAME: table2 | Name | Ex1 | Ex2 | Ex2 | Ex4 | Ex5 | ResSh2 | |--------+-----+-----+-----+-----+-----+--------| | Smith | 8 | 3 | 5 | 8 | 9 | 33 | | Miller | 2 | 1 | 6 | 9 | 3 | 21 | | Wick | 1 | 5 | 9 | 1 | 2 | 18 | #+TBLFM: $7=vsum($2..$6);f2 | Name | | ResSh1 | ResSh2 | Total | |--------+---+--------+--------+-------| | Smith | 4 | 22 | 33 | 59 | | Miller | 4 | 19 | 21 | 44 | | Wick | 4 | 18 | 18 | 40 | #+TBLFM: $3='(org-lookup-first $1 '(remote(table1, @I$1..@II$1)) '(remote(table1, @I$7..@II$7))) #+TBLFM: $5=vsum($2..$4) IIUC, it seems to be the result that you're expecting. Bruno > > Uwe > -- > Warning: Content may be disturbing to some audiences > 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/