emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Martin Gross <m-gross@gmx.net>
To: emacs-orgmode@gnu.org
Subject: calculate frequencies in a table with calc
Date: Tue, 25 Dec 2012 13:59:13 +0100	[thread overview]
Message-ID: <CAJkULmn6Xw9dqS7huWoQPESCLOh3PavF=WnCWfbsaU7RoeugGQ@mail.gmail.com> (raw)

Dear helpers,

on the web I found a formula to get frequencies which I modified to my
needs, but it does not yet work well.  An example:

|---------------------|
| [1, 2, 3, 4, 5]     |
| [6, 7, 8]           |
| [9, 10, 11, 12, 12] |
| 12, 12              |
|---------------------|
| 15                  |
| 2                   |
#+TBLFM: @5$1=vcount(@I..@II)::@6$1=vcount(map(<if(eq(#1,12),1,[])>,@I..@II))

With the first formula (@5$1) everything inside and outside the
brackets is counted, but with the second (@6$1), where I am asking for
the frequency of 12, only what is outside the brackets is considered.
How could I also include what is inside the brackets, so I get 4?

Thank you very much in advance!

Martin

             reply	other threads:[~2012-12-25 12:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-25 12:59 Martin Gross [this message]
2012-12-26  8:28 ` calculate frequencies in a table with calc Achim Gratz
  -- strict thread matches above, loose matches on Subject: below --
2012-12-27  8:57 Martin Gross

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAJkULmn6Xw9dqS7huWoQPESCLOh3PavF=WnCWfbsaU7RoeugGQ@mail.gmail.com' \
    --to=m-gross@gmx.net \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).