# Question about $and

**URL:** <https://community.mp3tag.de/t/question-about-and/18078>\
**Category:** Support\
**Created:** [June 29, 2016, 9:29pm UTC](https://community.mp3tag.de/t/question-about-and/18078 "2016-06-29T21:29:58Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mdwokfol](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/m/a183cd/32.png) [@mdwokfol](https://community.mp3tag.de/u/mdwokfol)\
**Post date:** [June 29, 2016, 9:29pm UTC](https://community.mp3tag.de/t/question-about-and/18078/1 "2016-06-29T21:29:58Z")

</div>

Why does this return 0?

$if($and(true,true), 1, 0)

I expect it to return 1.

---

<div class="post-metadata">

**Author:** ![Rijkstra](https://community.mp3tag.de/user_avatar/community.mp3tag.de/rijkstra/32/22_2.png) [@Rijkstra](https://community.mp3tag.de/u/Rijkstra)\
**Post date:** [June 29, 2016, 10:31pm UTC](https://community.mp3tag.de/t/question-about-and/18078/2 "2016-06-29T22:31:32Z")

</div>

Try it again without those spaces after the commas. They can cause problems. Also 'true' is intended to represent an expression in the documentation.

---

<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:** [June 30, 2016, 5:51am UTC](https://community.mp3tag.de/t/question-about-and/18078/3 "2016-06-30T05:51:59Z")

</div>

> [@mdwokfol](#):
>
> Why does this return 0?
> 
> $if($and(true,true), 1, 0)
> 
> I expect it to return 1.

You are missing the logic operation that is to be joined by the $and().

$if($eql('true','true')$and($eql('true','false')),1,0) will return 0  
$if($eql('true','true')$and($eql('true','true')),1,0) will return 1

BTW: "true" has no special meaning (e.g. keyword) but is just a string.

---

<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:** [June 30, 2016, 11:22am UTC](https://community.mp3tag.de/t/question-about-and/18078/4 "2016-06-30T11:22:30Z")

</div>

> [@mdwokfol](#):
>
> Why does this return 0?  
> $if($and(true,true), 1, 0) I expect it to return 1.

Obviously you are testing the logical function $and() with two strings, this will not work.  
You have to supply boolean values as parameters.

Try this ...

**Action: Format value Field: TEST Formatstring: $if($and($eql(1,1),$eql(1,1)),'yes','no') ... should give 'yes' Formatstring: $if($and($eql(1,11),$eql(1,1)),'yes','no') ... should give 'no'**

... and this ...

**Action: Format value Field: TEST Formatstring: $if($and($eql('true','true'),$eql(1,1)),'yes','no') ... should give 'yes' Formatstring: $if($and($eql('true','true'),$eql('yes','no')),'yes','no') ... should give 'no'**

DD.20160630.1522.CEST

---

<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:26pm UTC](https://community.mp3tag.de/t/question-about-and/18078/5 "2026-02-09T12:26:19Z")

</div>

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


