Test for range of values in a datatag using testforblock

//ads -- adsterra.com -- native banner
?>
I want to test for for a range of possible datatag values using the testforblock command. For example if I had a hopper where I want to check if it will transfer soon. For one specific value, I can use:
testforblock ~ ~ ~2 minecraft:hopper 0 {TransferCooldown:0}
But how can I test for a range of values? I tried using [0,1,...] but that didn't work.
In other situations I could also get a continuous value (specifically if I would use modded blocks), so is there any way to add a conditional statement like NBTValue < x or something?
Pictures about "Test for range of values in a datatag using testforblock"



How do you use the TestForBlock command in Minecraft?
You can test whether there is a certain block at a specific location in the game using the /testforblock command in Minecraft....TestForBlock Command in Minecraft Java Edition (PC/Mac)How do you test inventory items?
The blank is for the particular block you are looking for. Let's say you're lost in the Nether and need to find your Nether Portal, you could type : /locateblock obsidian, and get the coordinates for the nearest obsidian, most likely being your, said, Portal.Learn Command Blocks (Ep 2): Testfor \u0026 Testforblock
Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.
Images: Vanessa Loring, RF._.studio, Anna Shvets, George Milton