# using if function to compare 2 columns

**URL:** <https://community.mp3tag.de/t/using-if-function-to-compare-2-columns/14552>\
**Category:** Support\
**Created:** [March 18, 2013, 9:50am UTC](https://community.mp3tag.de/t/using-if-function-to-compare-2-columns/14552 "2013-03-18T09:50:30Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![sfincter](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/7ba0ec/32.png) [@sfincter](https://community.mp3tag.de/u/sfincter)\
**Post date:** [March 18, 2013, 9:50am UTC](https://community.mp3tag.de/t/using-if-function-to-compare-2-columns/14552/1 "2013-03-18T09:50:30Z")

</div>

having a bit of difficulty trying to compare two tags %artist% and %albumartist%  
basically i want to create a new column that i can use to sort all tracks where these 2 tags are not the same

created a new column 'test'

value = $if(%artist%=%albumartist%,'ok','problem')  
field = blank

but it returns 'ok' for all tracks ???  
looked in help and on forums but not having much luck

---

<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:** [March 18, 2013, 10:01am UTC](https://community.mp3tag.de/t/using-if-function-to-compare-2-columns/14552/2 "2013-03-18T10:01:26Z")

</div>

$if($eql(%artist%,%albumartist%),'ok','problem')

---

<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:** [March 18, 2013, 10:02am UTC](https://community.mp3tag.de/t/using-if-function-to-compare-2-columns/14552/3 "2013-03-18T10:02:31Z")

</div>

> [@sfincter](#):
>
> having a bit of difficulty trying to compare two tags %artist% and %albumartist%  
> basically i want to create a new column that i can use to sort all tracks where these 2 tags are not the same
> 
> created a new column 'test'
> 
> value = $if(%artist%=%albumartist%,'ok','problem')  
> field = blank
> 
> but it returns 'ok' for all tracks ???  
> looked in help and on forums but not having much luck

Try  
$if($eql(%artist%,%albumartist%),ok,Problem)

In general I would solve such a task with a filter:  
"$if($eql(%artist%,%albumartist%),1,0)" IS 1

---

<div class="post-metadata">

**Author:** ![sfincter](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/7ba0ec/32.png) [@sfincter](https://community.mp3tag.de/u/sfincter)\
**Post date:** [March 18, 2013, 10:11am UTC](https://community.mp3tag.de/t/using-if-function-to-compare-2-columns/14552/4 "2013-03-18T10:11:37Z")

</div>

Thanks for the prompt help my function building skills were not quite up to it  
works well and with 13k of tracks its going to make it a damn sight easier to fix my tags

> [@ohrenkino](#):
>
> Try  
> $if($eql(%artist%,%albumartist%),ok,Problem)
> 
> In general I would solve such a task with a filter:  
> "$if($eql(%artist%,%albumartist%),1,0)" IS 1

---

<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/using-if-function-to-compare-2-columns/14552/5 "2026-02-09T12:24:24Z")

</div>


