# Convert tags to filenames. Format string with 'if' function.

**URL:** https://community.mp3tag.de/t/convert-tags-to-filenames-format-string-with-if-function/14278
**Category:** Support
**Created:** [December 28, 2012, 5:15pm UTC](https://community.mp3tag.de/t/convert-tags-to-filenames-format-string-with-if-function/14278 "2012-12-28T17:15:57Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![muel2002](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/m/df788c/32.png) [@muel2002](https://community.mp3tag.de/u/muel2002)
#### Post date: [December 28, 2012, 5:15pm UTC](https://community.mp3tag.de/t/convert-tags-to-filenames-format-string-with-if-function/14278/1 "2012-12-28T17:15:57Z")

</div>

What I want to do is to write a format string which does this:

'%artistsort% (but if there is no data in this placeholder, use %artist%)'

What is the syntax I must use in order to maker this to happen?

Thanks

---

<div class="post-metadata">

### Author: ![dano](https://community.mp3tag.de/user_avatar/community.mp3tag.de/dano/32/6_2.png) [@dano](https://community.mp3tag.de/u/dano)
#### Post date: [December 28, 2012, 5:18pm UTC](https://community.mp3tag.de/t/convert-tags-to-filenames-format-string-with-if-function/14278/2 "2012-12-28T17:18:25Z")

</div>

$if2(%artistsort%,%artist%)

---

<div class="post-metadata">

### Author: ![muel2002](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/m/df788c/32.png) [@muel2002](https://community.mp3tag.de/u/muel2002)
#### Post date: [December 28, 2012, 5:29pm UTC](https://community.mp3tag.de/t/convert-tags-to-filenames-format-string-with-if-function/14278/3 "2012-12-28T17:29:46Z")

</div>

Thanks. In the end, really straight forward

I should have looked properly in the help docs, or used my brain more. I'm getting lazy.

---

<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:24pm UTC](https://community.mp3tag.de/t/convert-tags-to-filenames-format-string-with-if-function/14278/4 "2026-02-09T12:24:14Z")

</div>


