# calculate average bitrate

**URL:** https://community.mp3tag.de/t/calculate-average-bitrate/19540
**Category:** Export
**Created:** [November 18, 2017, 6:36pm UTC](https://community.mp3tag.de/t/calculate-average-bitrate/19540 "2017-11-18T18:36:59Z")
**Posts on this page:** 1
**Showing post:** 1

<div class="post-metadata">

### Author: ![gladglam](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/g/e47c2d/32.png) [@gladglam](https://community.mp3tag.de/u/gladglam)
#### Post date: [November 18, 2017, 6:36pm UTC](https://community.mp3tag.de/t/calculate-average-bitrate/19540/1 "2017-11-18T18:36:59Z")

</div>

Hi. I recently tried to create .nfos with some homemade template heavily borrowing from existing scripts since scripting isn't my area of expertise 😃

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%))$puts(cnt1,$add($get(cnt1),1))$loopend()$div($get(Vbitrate),get(cnt1))`

but all I get is numbers around of above 10000 for standard flac 16-44 or typically 3200 for say a ten tracks album @ 320k (it's sure useless to calculate average for CBR by definition, it's just to show what's calculated)  
so either the division function must be called differently or the cnt1 number/divider is stuck to one...

what am I missing ?

---

_[View the full topic](https://community.mp3tag.de/t/calculate-average-bitrate/19540)._
