# How to write a formula to get text length in a Math column?

**URL:** https://community.glideapps.com/t/how-to-write-a-formula-to-get-text-length-in-a-math-column/82574
**Category:** Ask for Help
**Created:** [June 18, 2025, 7:53am UTC](https://community.glideapps.com/t/how-to-write-a-formula-to-get-text-length-in-a-math-column/82574 "2025-06-18T07:53:44Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![ttss3131](https://avatars.discourse-cdn.com/v4/letter/t/4af34b/32.png) [@ttss3131](https://community.glideapps.com/u/ttss3131)
#### Post date: [June 18, 2025, 7:53am UTC](https://community.glideapps.com/t/how-to-write-a-formula-to-get-text-length-in-a-math-column/82574/1 "2025-06-18T07:53:44Z")

</div>

Hello. I am a user from Japan developing an app with Glide. I have a problem I can’t solve while implementing an “AND search” feature and was hoping for your help.

**My Goal:** I am trying to create an “AND search” feature where a user selects multiple ingredients (e.g., “Pork”, “Onion”), and only recipes containing **all** of those selected ingredients are displayed.

**The Problem:** To achieve this, I first need to check if a helper column is empty or not. I tried to do this by counting the number of characters in that column using a `Math` column.

My helper column is a Template column named `ユーザー選択1_テキスト`.

When I enter the formula `LEN(ユーザー選択1_テキスト)` in the Math column, I get the following error: `Around "ー選択1_テキス": There should be a "," or a ")"`

(Please see the attached screenshot for the error.)

**My Question:** In the `Math` column, what is the **correct current syntax/formula in Glide to count the number of characters in another column** (in this case, `ユーザー選択1_テキスト`)?

Thank you for your help.

---

<div class="post-metadata">

### Author: ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)
#### Post date: [June 18, 2025, 7:59am UTC](https://community.glideapps.com/t/how-to-write-a-formula-to-get-text-length-in-a-math-column/82574/2 "2025-06-18T07:59:14Z")

</div>

> [@ttss3131](#):
>
> **My Goal:** I am trying to create an “AND search” feature where a user selects multiple ingredients (e.g., “Pork”, “Onion”), and only recipes containing **all** of those selected ingredients are displayed.
> 
> **The Problem:** To achieve this, I first need to check if a helper column is empty or not. I tried to do this by counting the number of characters in that column using a `Math` column.

Let me first say that you appear to be approaching this in a very roundabout way. The normal way to do this would be to first create an array from the selection using a Split Text column, and then use that as a filter - either by creating a relation, or by using `contains` in an if-then-else column.

However, I’ll ignore that for now and directly answer your question…

> [@ttss3131](#):
>
> **My Question:** In the `Math` column, what is the **correct current syntax/formula in Glide to count the number of characters in another column** (in this case, `ユーザー選択1_テキスト`)?

Don’t use a Math column. Instead, use a Text Length column.

Also…

> [@ttss3131](#):
>
> To achieve this, I first need to check if a helper column is empty or not. I tried to do this by counting the number of characters in that column using a `Math` column.

You can directly check if a column is empty or not with an if-then-else column. You don’t need to check the number of characters.

---

<div class="post-metadata">

### Author: ![ttss3131](https://avatars.discourse-cdn.com/v4/letter/t/4af34b/32.png) [@ttss3131](https://community.glideapps.com/u/ttss3131)
#### Post date: [June 18, 2025, 11:13am UTC](https://community.glideapps.com/t/how-to-write-a-formula-to-get-text-length-in-a-math-column/82574/3 "2025-06-18T11:13:55Z")

</div>

Thank you so much for your quick and accurate response! Your advice, especially that I can directly check if the `Single Value` column `is empty` in the If-Then-Else column, was the key. I had created many unnecessary helper columns.

By simplifying the logic as you suggested, I was able to solve the problem perfectly. Thank you again!

---

<div class="post-metadata">

### Author: ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/system/32/53398_2.png) [@system](https://community.glideapps.com/u/system)
#### Post date: [June 25, 2025, 11:13am UTC](https://community.glideapps.com/t/how-to-write-a-formula-to-get-text-length-in-a-math-column/82574/4 "2025-06-25T11:13:59Z")

</div>

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
