Get minimum/maximum value from loop in template script?

Is there a way I can get minimum/maximum values from numeric fields, such as %_bitrate%, from a list of files ($loop)?

Specifically, I'm looking to create an output like

Bitrate: 800-1500 kbps

For a list of files with values like

Track 1: Bitrate: 900 kbps
Track 2: Bitrate: 800 kbps
Track 3: Bitrate: 1200 kbps
Track 4: Bitrate: 1500 kbps
Track 5: Bitrate: 1000 kbps

Is there a way to do this?

The search words "minimum maximum export" get this hit:

So sorry, I missed that!
Thank you :+1: :blush:

FWIW, here is the line that compares, sets and outputs the min/max for the %_bitrate% field, using variables called brMin and brMax for intermediate values.
Replace those with what you're after if you're looking to do something similar

$loop(%File%)$loop(%File%)$puts(brMin,$if($or($less(%_bitrate%,$get(brMin)),$less($get(brMin),1)),%_bitrate%,$get(brMin)))$puts(brMax,$if($or($grtr(%_bitrate%,$get(brMax)),$less($get(brMax),1)),%_bitrate%,$get(brMax)))$loopend()$get(brMin)-$get(brMax)$loopend() kbps

This will render

800-1500 kbps

for the above example scenario.

Thank you to @rko31415, that looks like a nightmare to set up :sweat_smile: