From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id mJczKYdP+mIzPgEAbAwnHQ (envelope-from ) for ; Mon, 15 Aug 2022 15:52:07 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id 6DpjKYdP+mL18AAAauVa8A (envelope-from ) for ; Mon, 15 Aug 2022 15:52:07 +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 3CB6F1F71B for ; Mon, 15 Aug 2022 15:52:07 +0200 (CEST) Received: from localhost ([::1]:38442 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oNaVi-0000VV-13 for larch@yhetil.org; Mon, 15 Aug 2022 09:52:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58408) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oNaV8-0000Ul-Ax for emacs-orgmode@gnu.org; Mon, 15 Aug 2022 09:51:30 -0400 Received: from smtp152.vfemail.net ([146.59.185.152]:45467) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oNaV6-0007I1-84 for emacs-orgmode@gnu.org; Mon, 15 Aug 2022 09:51:30 -0400 Received: (qmail 15167 invoked from network); 15 Aug 2022 13:51:25 +0000 Received: from localhost (HELO freequeue.vfemail.net) () by smtpout.vfemail.net with ESMTPS (ECDHE-RSA-AES256-GCM-SHA384 encrypted); 15 Aug 2022 13:51:25 +0000 Received: (qmail 1900 invoked from network); 15 Aug 2022 13:50:49 -0000 Received: from localhost (HELO nl101-2.vfemail.net) (bmE=@127.0.0.1) by freequeue.vfemail.net with (DHE-RSA-AES256-SHA encrypted) SMTP; 15 Aug 2022 13:50:49 -0000 Received: (qmail 1349 invoked from network); 15 Aug 2022 13:50:24 -0000 Received: by simscan 1.4.0 ppid: 1345, pid: 1347, t: 0.0055s scanners:none Received: from unknown (HELO localhost) (ZWRnYXJAb3Blbm1haWwuY2M=@192.168.1.192) by nl101.vfemail.net with ESMTPA; 15 Aug 2022 13:50:24 -0000 Date: Mon, 15 Aug 2022 13:50:59 +0000 Message-ID: <20220815135059.Horde.0yrWgPRhFF6o7SxGXFD4fgW@www.vfemail.net> From: edgar@openmail.cc To: emacs-orgmode@gnu.org Subject: how to concatenate string to spreadsheet formula User-Agent: Horde Application Framework 5 X-VFEmail-Originating-IP: 2405:8100:8000:5ca1::10f:c9e8 X-VFEmail-AntiSpam: Notify admin@vfemail.net of any spam, and include VFEmail headers Content-Type: text/plain; charset=utf-8; format=flowed; DelSp=Yes MIME-Version: 1.0 Content-Disposition: inline Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=146.59.185.152; envelope-from=edgar@openmail.cc; helo=smtp152.vfemail.net X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FROM=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, UNPARSEABLE_RELAY=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" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1660571527; 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: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=uqTqBtcianTzN5TBagJyxnXcUjo6u1xUDjbEAToJxZ4=; b=oLpJqFnnSSFq1/vVgg0YR3VHEAitMlaIbapqG5JWKKW1PHWmRm+2p3G91KWsz+fHvStu+f DcXg6pr89zhNBXntHrO7/KO20QVrhDbymeE2Du52AVSdam+sK2+CPamOrglQO0xOheM352 gQdJQVxAcSZfn/gbiWW5wDtIFEIuMbjC2A8NnROyHH9VldT57UIcNczC03D65+eMohKzMp g4QcLlcpqc/qXbFNNy98pEoZa0JF9B54EnrY8Fx8AVLHf+mpy/0aphcb+SXX9eU+lM6IAm t5MjyZh9MhiT7r0G6ua03LjCbgwpSaVTUYPwIJF7ahdq7qvppsx5QguXJNow1g== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1660571527; a=rsa-sha256; cv=none; b=IuEUH46ywioaCeL2UcuefumViIhwVxw+rTiCF8Yytea+N0movXjbDfSFS/jo/VJDaP/bxN JX6i+8mwMyZDxlH/syTp8sZocsY2yfn6NNQpyJWCJ6PqeeuN8DUHs0SHJTjqG+UUp7InHD zvjz47FnH6GENiXRiw0wxL2kXJ/hNP9yAc9mAUgNjjp8EBLfujU/D5YLLNJHWD/m/kjfPx I6Ne1HTPNskm/tmqfS4eKWME/UYuvdRlMcV0p1i7PAl0hZeod0wzjjKtQW1oF7FRt/2jEK CeVBwEUdi/PQ4W2xnjvBTjayPRufNTGF7li7qcjiQBwjUrnKZgm6vS2vrxGa4Q== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; 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" X-Migadu-Spam-Score: -3.26 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; 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" X-Migadu-Queue-Id: 3CB6F1F71B X-Spam-Score: -3.26 X-Migadu-Scanner: scn0.migadu.com X-TUID: SOz3JT8Lk9zE Dear everyone, At the moment, I am using an Org spreadsheet to concatenate a string to the ratio between 2 numbers. One of numbers is the [[sum-of-column][sum of a column]]. The other number would correspond to [[each-row-col1][each of the rows of another column]] ([[ratio-to-0.95][multiplied by a factor]]) 1. <>calculate the sum of a column - originally wanted vsum - corresponding part: =(reduce '+ (mapcar 'string-to-number (list @5$<..@6$<)))= 2. <>each of the values in column 1 (string-to-number $1) 3. <>the ratio between [[each-row-col1]] and [[sum-of-column]] is multiplied by 0.95 The final value is concatenated with "\\textwidth". | width | height | w / Σw | w / pic_row | | 204 | 120 | 0.10418795 | 0.32606557 | | 215 | 125 | 0.10980592 | 0.34364754 | | 191 | 119 | 0.097548519 | 0.30528689 | | 483 | 125 | 0.24668029 | 0.7294912559614499\textwidth | | 146 | 128 | 0.074565884 | 0.22050874403854998\textwidth | | 719 | 101 | 0.36721144 | | |-------+--------+-------------+-------------------------------| | 1958 | 718 | | | #+tblfm: @5$4..@6$4='(concat (number-to-string (* 0.95 (string-to-number (math-format-number (math-div (string-to-number $1) (reduce '+ (mapcar 'string-to-number (list @5$<..@6$<)))))))) "\\textwidth") Is there a more succint way of doing this? For instance, my original intention was to have something like #+tblfm: @5$4..@6$4=vsum($1 / vsum(@5$<..@6$<);"%0.4f\\textwidth" which does not work. I would also like to avoid creating another column (=#+tblfm: @5$4..@6$4=vsum($1 / vsum(@5$<..@6$<);%0.4f::@<<$5..@>>$5='(concat $4 "\\textwidth")=). Thank you very much! ------------------------------------------------- This free account was provided by VFEmail.net - report spam to abuse@vfemail.net ONLY AT VFEmail! - Use our Metadata Mitigator to keep your email out of the NSA's hands! $24.95 ONETIME Lifetime accounts with Privacy Features! 15GB disk! No bandwidth quotas! Commercial and Bulk Mail Options!