Counting Instances

Hi everyone,

I've used Libre Office for years, but I am an absolute newbie as far as Calc is concerned for anything but the very basics. :slight_smile:

Here is my problem.

My church has to report to the copyright licence holders the names of the songs it uses and the number of times each song is used in a given time period.

The software we use for projecting the words for songs (OpenLP) will produce the name of each song used in each service. It will generate a CSV

Obviously it is easy enough to import that into a spreadsheet.

How can I then count the number of times each song is used? I could sort the table by song title and then count them manually, but I am guessing there would be some sort of function that automates the counting.

Thanks for any help on this.

Kieth

I would try the COUNTIF(). The syntax is =COUNTIF(range, criteria). The range is the column with the titles and the criteria is the title you want counted. I would set up the data one sheet and in another I would set a column with each title and in the next column have =COUNTIF(datasheet.range, cell). The only problem is if you accidentally missed of the titles in the range. Assuming an average of 3 services per week that use 5 songs you have about 780 separate instances that a song was used. I can see easily missing a single title.

An alternative is to use Base with the data uploaded to a table. CSV files work very well with databases. Then the have Base count each title. Most people find databases more intimidating because they do not directly work them. But once you get familiar with them you might find this an easier approach for problems like this.

I tend to use raw SQL when working with Base (mostly because I use SQL at work). In SQL the query would look like this:

SELECT Count(*) AS Count <AS count is optional>
FROM Songs <use actual table name>
GROUP BY Title <use actual column name which has the titles>

If you want you can send me a typical dataset to off list and I will look at both with Calc and Base.

Jay

I'm wondering if you are expected to pay royalties on the music. If so, I would think that there is
enough sacred music in the public domain that you could forget about the problem, and save
money for the church to use for religious purposes. You should have your music director look into that.
--doug

Hi Keith,

Keith Bates schrieb:

Hi everyone,

I've used Libre Office for years, but I am an absolute newbie as far as
Calc is concerned for anything but the very basics. :slight_smile:

Here is my problem.

My church has to report to the copyright licence holders the names of
the songs it uses and the number of times each song is used in a given
time period.

The software we use for projecting the words for songs (OpenLP) will
produce the name of each song used in each service. It will generate a CSV

Obviously it is easy enough to import that into a spreadsheet.

How can I then count the number of times each song is used? I could sort
the table by song title and then count them manually, but I am guessing
there would be some sort of function that automates the counting.

Thanks for any help on this.

Import the csv data into the spreadsheet.
Define a data range for this data including the field names.
Generate a pivot table from it this way:
- drag the field name of the song title to the "Row Fields"
- drag the same field name to the "Data Fields".
- Double click the field name button in the "Data Fields" area and change the function from "sum" to "count".
OK

Using a pivot table has the advantage, that you do not need to know beforehand, which song titles are contained in the list.

Kind regards
Regina

Aside on copyright. The problem is the song book may include works that still have a copyright. Given the length of copyrights you might be surprised what still has a valid copyright. For music, royalties are do for publication (song book), performance (this situation), broadcasting the song, and using it other media (movie for example). While I do not know Australian copyright details the general details are the same by international treaties. In the US the fines can get very steep for copyright infringement - up to $150k per infringement. So being proactive and paying the royalties will much cheaper in the long run if a bit of a pain.

+1
That's how I'd do it.

The licence is through CCLI (www.ccli.com) and is a flat fee based on the size of the congregation. The total fees are divided amongst the song authors based on total song usage.

For contemporary music it is a very cost effective way of legally reproducing lyrics and music.

Just as another option, you can also use "Data | Subtotals", although I
think a pivot table is probably nicer looking.

Let's say you have a simple list of song names in column A. For
some reason this operation seems to expect a header row, and I
didn't see an option not to use one, so make sure you have a
header row above the song names (create a blank row if needed).
Then simply select from the header cell all the way down the column
to include all the songs. Now go to "Data | Subtotals". The first tab
("1st Group") should have "Column A" (or the header name) in the "Group
by" dropdown. Click on "Count" under "Use function", and "Column A" (or
the header name) should become ticked in the "Calculate subtotals for"
list. Check that the checkbox for "Pre-sort area according to
groups" on the "Options" tab is checked. Click "OK", and you should see
the list of song names grouped by each song, with a subtotal and a
grand total.

Paul

Thank you to everyone who offered help with this.

I found the pivot table option to be the best one- thanks Regina for your detailed instructions.

Before today, I had no idea what a pivot table is- now apparently I can use one :slight_smile:

I might read the user guide now to deepen my understanding.

Paul suggested using Subtotals on the column with the song title, but I found this sorted just that column which separated the song titles from other fields. I guess I could have selected the other fields as part of the sorting/sub-totalling, but the pivot table has the advantage of giving the information without messing with the data.

Paul suggested using Subtotals on the column with the song title, but
I found this sorted just that column which separated the song titles
from other fields. I guess I could have selected the other fields as
part of the sorting/sub-totalling,

Yes, sorry, I should have mentioned this. You will want to select all
the columns that have data, they will be sorted together.

but the pivot table has the
advantage of giving the information without messing with the data.

Yes, I also found it the best solution. I too haven't really used them
much. Hopefully I will remember them next time I need this.

Glad you found a solution that worked well for you.

Paul