# Format Value (Calculation Across Selected Files)

**URL:** https://community.mp3tag.de/t/format-value-calculation-across-selected-files/66347
**Category:** Support
**Created:** [October 24, 2024, 10:24pm UTC](https://community.mp3tag.de/t/format-value-calculation-across-selected-files/66347 "2024-10-24T22:24:14Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![mista\_j](https://community.mp3tag.de/user_avatar/community.mp3tag.de/mista_j/32/15808_2.png) [@mista\_j](https://community.mp3tag.de/u/mista_j)
#### Post date: [October 24, 2024, 10:24pm UTC](https://community.mp3tag.de/t/format-value-calculation-across-selected-files/66347/1 "2024-10-24T22:24:14Z")

</div>

I have a field called "Explicit Score" this is a 3 digit numerical value that is calculated based on the number of choice words found in the lyrics of any given track.

I'd like to be able to select the tracks of an album & add up the explicit scores from each selected track & place that total value into %Description% for each track.

Not sure where to begin with this one, any suggestions?

---

<div class="post-metadata">

### Author: ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)
#### Post date: [October 25, 2024, 6:00am UTC](https://community.mp3tag.de/t/format-value-calculation-across-selected-files/66347/2 "2024-10-25T06:00:41Z")

</div>

> [@mista\_j](#):
>
> Not sure where to begin with this one

I would think that a look at the scripting functions is a good first step:

> **[Scripting Functions – Mp3tag Documentation](https://docs.mp3tag.de/scripting/)**
>
> Documentation on Mp3tag's scripting functions. Mp3tag is the universal Tag Editor.

and if that does not bring you any further, then

> [@Hints for asking Support Requests](https://community.mp3tag.de/t/hints-for-asking-support-requests/56190):
>
> If you need support using Mp3tag, you can help the community members that are about to support you in finding a solution or workaround to your problem, by following these simple guidelines. Be descriptive, also in what you’ve already tried Please give a short explanation what’s not working as expected or what you’re trying to achieve. It’s best to know any details about the problem at hand and especially, what steps you’ve already tried to solve it by yourself. Helpful information also includ…

esp. the part about screenshots and examples.

---

<div class="post-metadata">

### Author: ![mista\_j](https://community.mp3tag.de/user_avatar/community.mp3tag.de/mista_j/32/15808_2.png) [@mista\_j](https://community.mp3tag.de/u/mista_j)
#### Post date: [October 25, 2024, 7:25am UTC](https://community.mp3tag.de/t/format-value-calculation-across-selected-files/66347/3 "2024-10-25T07:25:30Z")

</div>

Unfortunately my laptop is currently out of commission for a bit so im unable to send screenshots but in my case I have 3 files for example

Title1 - Artist1  
Explicit Score 35

Title2 - Artist2  
Explicit Score 10

Title3 - Artist3  
Explicit Score 12

I'd like to select all 3 files & calculate the total "score" for these 3 files

So in this case 35+10+12 = 57

On each of these files id like to add the value 57 to a field "Description" on each file respectively.

As far as i know scripting in mp3tag is per file so I wasnt sure it was possible to use arithmetic scripting across multiple files besides using a placeholder such as %\_total\_files% which can give you a number based on how many files are currently selected.

The values im trying to sum are the same tag field but on different tracks

---

<div class="post-metadata">

### Author: ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)
#### Post date: [October 25, 2024, 7:27am UTC](https://community.mp3tag.de/t/format-value-calculation-across-selected-files/66347/4 "2024-10-25T07:27:55Z")

</div>

> [@mista\_j](#):
>
> The values im trying to sum are the same tag field but on different tracks

You are quite right: MP3tag does not compare or remember the data from different files.  
The only way would be an export script that sums up the value into a text file from where you can import it.

E.g. here is an export script that calculates an average:

> [@calculate average bitrate](https://community.mp3tag.de/t/calculate-average-bitrate/19540):
>
> Hi. I recently tried to create .nfos with some homemade template heavily borrowing from existing scripts since scripting isn't my area of expertise smiley One thing I can't make work and I have no clue why is calculating average bitrate. I stole the "looping add and divide" formula from old scripts found in this forum section, the addition part works, not the division... ie this is supposed to display the average number : $loop(%\_filename\_ext%)$puts(Vbitrate,$add($get(Vbitrate),%\_bitrate%)…

So, if you leave out the division at the end, you should get what you want.

---

<div class="post-metadata">

### Author: ![mista\_j](https://community.mp3tag.de/user_avatar/community.mp3tag.de/mista_j/32/15808_2.png) [@mista\_j](https://community.mp3tag.de/u/mista_j)
#### Post date: [October 25, 2024, 7:38am UTC](https://community.mp3tag.de/t/format-value-calculation-across-selected-files/66347/5 "2024-10-25T07:38:17Z")

</div>

Hmmm ok. I think my workaround (due to my lack of scripting writing knowledge) would be an action that exports just the Scores to a text document

Score1,Score2,Score3

Then i could import that text file to all the selected files & the info could go to a throw away field %BIN%

I could use guess to populate a number of extra throw away fields as needed depending on the number of "," present in %BIN% in this case there are 2 "," present therefore we have 3 scores.

My guess would be %BIN1%,%BIN2%,%BIN3%

Then using arithmetic scripting add BIN1-BIN3

I think that might do it again no computer so id have to test it another time but does that sound feasible?

---

<div class="post-metadata">

### Author: ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)
#### Post date: [October 25, 2024, 7:40am UTC](https://community.mp3tag.de/t/format-value-calculation-across-selected-files/66347/6 "2024-10-25T07:40:01Z")

</div>

> [@mista\_j](#):
>
> but does that sound feasible?

There are so many ways to skin a cat.  
If you find a working method then that is the way to go.

---

<div class="post-metadata">

### Author: ![mista\_j](https://community.mp3tag.de/user_avatar/community.mp3tag.de/mista_j/32/15808_2.png) [@mista\_j](https://community.mp3tag.de/u/mista_j)
#### Post date: [October 25, 2024, 7:41am UTC](https://community.mp3tag.de/t/format-value-calculation-across-selected-files/66347/7 "2024-10-25T07:41:26Z")

</div>

Very true I'll try both methods & whichever one doesnt drive me insane is what ill go with. Thanks again

---

<div class="post-metadata">

### Author: ![system](https://community.mp3tag.de/uploads/default/original/2X/c/ce7035d426cb755a7916793326d23b465222a407.png) [@system](https://community.mp3tag.de/u/system)
#### Post date: [November 24, 2024, 7:41am UTC](https://community.mp3tag.de/t/format-value-calculation-across-selected-files/66347/8 "2024-11-24T07:41:58Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
