# Conditional tagging involving years in range

**URL:** <https://community.mp3tag.de/t/conditional-tagging-involving-years-in-range/15947>\
**Category:** Support\
**Created:** [July 27, 2014, 11:59pm UTC](https://community.mp3tag.de/t/conditional-tagging-involving-years-in-range/15947 "2014-07-27T23:59:45Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Harakiri](https://community.mp3tag.de/user_avatar/community.mp3tag.de/harakiri/32/142_2.png) [@Harakiri](https://community.mp3tag.de/u/Harakiri)\
**Post date:** [July 27, 2014, 11:59pm UTC](https://community.mp3tag.de/t/conditional-tagging-involving-years-in-range/15947/1 "2014-07-27T23:59:45Z")

</div>

Good evening!

I want to create a if function to populate %comment% with data if %year% ranges from 1980 to 1989. I tried to learn my way unsuccessfully... ...example follows...

Action type: Format value  
Field: COMMENT  
Format string: $if($eql($regexp(%year%,^(198\d|1989)$),Eighties,)

I would appreciate any help you could give me. Thank you in advance for your attention! 🙂

---

<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:** [July 28, 2014, 3:33am UTC](https://community.mp3tag.de/t/conditional-tagging-involving-years-in-range/15947/2 "2014-07-28T03:33:03Z")

</div>

> [@Harakiri](#):
>
> ...  
> Action type: Format value  
> Field: COMMENT  
> Format string: $if($eql($regexp(%year%,^(198\d|1989)$),Eighties,)  
> ...

I do not think that you have files from 1198 or 2198 so it would be sufficient to check if 198 can be found in YEAR:

$ifgreater($strstr(%year%,198),0,Eighties,)

---

<div class="post-metadata">

**Author:** ![DetlevD](https://community.mp3tag.de/user_avatar/community.mp3tag.de/detlevd/32/123_2.png) [@DetlevD](https://community.mp3tag.de/u/DetlevD)\
**Post date:** [July 28, 2014, 5:35am UTC](https://community.mp3tag.de/t/conditional-tagging-involving-years-in-range/15947/3 "2014-07-28T05:35:14Z")

</div>

> [@Harakiri](#):
>
> ... I want to create a if function to populate %comment% with data if %year% ranges from 1980 to 1989. ...  
> Format string: $if($eql($regexp(%year%,^(198\d|1989)$),Eighties,)  
> I would appreciate any help you could give me. Thank you in advance for your attention! 🙂

**$if($eql($div(%YEAR%,10),196),'Sixties',) $if($eql($div(%YEAR%,10),197),'Seventies',) $if($eql($div(%YEAR%,10),198),'Eighties',) ... or ... $div(1960,10)'0s' ==\> '1960s' $div(1970,10)'0s' ==\> '1970s' $div(1980,10)'0s' ==\> '1980s' ... or ... $left(%YEAR%,3)'0s' ==\> 'yyy0s'**

DD.20140728.0935.CEST

---

<div class="post-metadata">

**Author:** ![Harakiri](https://community.mp3tag.de/user_avatar/community.mp3tag.de/harakiri/32/142_2.png) [@Harakiri](https://community.mp3tag.de/u/Harakiri)\
**Post date:** [July 28, 2014, 5:41pm UTC](https://community.mp3tag.de/t/conditional-tagging-involving-years-in-range/15947/4 "2014-07-28T17:41:31Z")

</div>

Thank you, it worked perfectly! 🙂

---

<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:** [February 9, 2026, 12:25pm UTC](https://community.mp3tag.de/t/conditional-tagging-involving-years-in-range/15947/5 "2026-02-09T12:25:09Z")

</div>

Closed on February 9, 2026, 12:25pm UTC


