Wrong If-Then-Else Result

Hello all,

I have an If → Then → Else column in Glide that categorizes QS rankings.

Source value examples:

58
130
416

Logic:

If value ≤ 10 → Top 10
If value ≤ 50 → Top 50
If value ≤ 100 → Top 100
If value ≤ 150 → Top 150
If value ≤ 200 → Top 200
If value ≤ 300 → Top 300
If value ≤ 500 → Top 500
If value > 500 → 500+

The issue:

58 returns Top 10 instead of Top 100.
416 returns Top 10 instead of Top 500.
130 returns Top 150 correctly.

I also created a Math helper column to force the value as a number, but the issue still happens.

Is this a caching bug, column type issue, or If → Then → Else issue? What is the best workaround?

Interesting. I would assume it’s comparing as text, but I’m not quite understanding the pattern.

Can you try recreating the IF column from scratch?

Hi,
Invert the if, the largest numbers at the beginning and the 10 last, or use only the smallest Example: If QS World < 11 then Top 10


I did, and noticed that it always reads the first logic and applies it to the rest whether it is true. I think it is a glitch? How to report it to Glide team if it is?

I did, and still the same. I also inverted IF THEN ELSE and it turned out to keep reading the first logic no matter what.

Can you trace up through the QS World column? Is there anywhere in the path upwards where it may not return a numeric value or may be a number in a text column? Normally you wouldn’t even be presented with mathematical operators it it’s text, but I think I’m missing a piece of the puzzle.

Otherwise you can use the chat bubble in the bottom right of the builder to escalate to support, but I’m not convinced that it’s a bug yet. Otherwise there would be a lot of people complaining about broken IF logic.

What the reason for the “If | QS World” column? Could you configure the “QS Test” column by referring to “Ranking | QS World (General)” lookup column directly?

What is the type of the column “Ranking | QS World (General)” is looking up? Is it a math or number column?

The “General” value comes from another numerical table. In other words, the source columns are all numeric.

What makes this unusual is that I am using almost 10 similar tables, and around 7 of them work perfectly with the same logic. Other ranking categories also work correctly, and they look up their values from the same ranking table as numeric values.

The issue only appears in the specific columns/screenshots I shared. That is why I suspected it might not be a formula logic issue, because the same structure works elsewhere with the same type of numeric lookup source.

I created the “If | QS World” column only as a workaround/test layer to normalize the looked-up numeric value before applying the category logic, but the source itself is already numerical. Check the screenshot, there is where I get the Ranking | QS Word General.

Check this out. Shanghai Final column I believes it reads a hidden number which is why it returns with 500 + because Shanghai Final column is empty. I cleaned it up multiple times and didn’t work.

This is the source where General column gets the ranking from, all of them are numeric.

Could you double-click on the header of “If | Shanghai” and show a screenshot of how that if-then-else column is configured?

I’d be curious to see how you’ve configure “If | QS World” and “If | Shanghai”. If you share screenshots, could you share the entire configuration including the “Else” field.

@nathanaelb @Jeff_Hager @Federico_Fleitas

Thank you for trying to help.

Here is the full configuration.

I am trying to understand why the same ranking logic works correctly in most tables, but gives incorrect results in a few specific columns.
**
Screenshot 1: General Overview**
This screenshot shows the final output columns side by side:

  • Ranking | QS World (Major)
  • Ranking | QS World (General)
  • If | QS World
  • QS Final

The intended logic is:

  • If the major-specific QS ranking exists, use Ranking | QS World (Major).
  • If the major-specific ranking is empty, use Ranking | QS World (General).
  • Then classify the selected rank into Top 10, Top 50, Top 100, Top 150, etc.

In the screenshot, rows with General QS ranking 42 are correctly classified as Top 50. However, rows with rank 82 are incorrectly classified as Top 10, even though 82 should be Top 100.

Screenshot 2: Ranking | QS World (Major)
This column is a Number column.
It contains the major-specific QS subject ranking when available.
When this column is empty, the system should fall back to the general QS ranking.

Screenshot 3: Ranking | QS World (General)
This column is a Lookup column.
It pulls the general QS ranking from a related table.
The source column being looked up is numerical.
This same source table and numeric ranking structure are also used by other ranking categories/tables that work correctly.

Screenshot 4: If | QS World
This is an If → Then → Else column.
The logic is:
IF Ranking | QS World (Major) is not empty
THEN Ranking | QS World (Major)
ELSE Ranking | QS World (General)
So this column is only meant to choose the major ranking first when it exists, and otherwise use the general ranking.
Example:

  • If Major rank exists: use Major rank.
  • If Major rank is empty: use General rank.
    The output appears numeric in the table. For example, it returns 42 and 82 correctly.

Screenshot 5: QS Final
This is another If → Then → Else column.
It reads from If | QS World and categorizes the rank:

IF If | QS World <= 10 → Top 10
IF If | QS World <= 50 → Top 50
IF If | QS World <= 100 → Top 100
IF If | QS World <= 150 → Top 150
IF If | QS World <= 200 → Top 200
and so on.

The expected behavior:

  • 42 should return Top 50.
  • 82 should return Top 100.
  • 155 should return Top 200.
  • 278 should return Top 300 or Top 500 depending on the category setup.

The problem:
Some values are being classified incorrectly. For example, rank 82 is returning Top 10, even though it is not <= 10. This suggests that the issue may not be with the visible logic itself, because the same structure works correctly in other tables/categories.

Source table screenshot:
The source table contains numeric ranking columns, including:

  • Ranking | QS
  • Ranking | THE
  • Ranking | Shanghai
  • Ranking | US News
    These are number columns, and Ranking | QS World (General) is looking up its value from this numeric source table.

**
What I need help understanding:**

Why would Glide classify 82 as Top 10 when the condition is If | QS World <= 10?

All relevant source columns are numerical, and the lookup source is also numerical. The same logic works correctly in several other tables and ranking categories. The issue only appears in some specific columns, which makes it look like either:

1. Glide is treating the lookup/If output differently from a normal number in this specific table,

2. the If → Then → Else column is evaluating the wrong condition order internally,

3. there may be a cached/glitched computed column,

4. or the lookup result is visually numeric but not being evaluated as a clean number.

The mistake needing a solution:

The QS Final column is assigning the wrong category to some numeric values. Specifically, values like 82 are being returned as Top 10 instead of Top 100. I need to know whether this is caused by the Lookup column, the intermediate If | QS World column, the final If → Then → Else logic, or a Glide computation/cache issue.

@nathanaelb @Jeff_Hager @Federico_Fleitas

I found the solution to my Glide If → Then → Else ranking issue, and would like to share it with you all hopefully it helps.

My setup:

Ranking | US News (General) = original ranking number
If | US News = final ranking value used by the app
US News Final = category column
US News Math = math helper column
Correct Answers = manual column I used to verify the expected result

The issue:

If | US News was showing 105, but US News Final returned Top 10.

That was wrong because:

105 should be Top 150, not Top 10.

Even though the value looked numeric, Glide was not evaluating it correctly inside the If → Then → Else category logic.

The fix:

I created a Math column called:

US News Math

Then I used this formula:

N * 1

where N = If | US News

After that, I rebuilt the category If → Then → Else using US News Math instead of If | US News.

Correct logic:

If US News Math ≤ 10 → Top 10
If US News Math ≤ 50 → Top 50
If US News Math ≤ 100 → Top 100
If US News Math ≤ 150 → Top 150
If US News Math ≤ 200 → Top 200
If US News Math ≤ 300 → Top 300
If US News Math ≤ 500 → Top 500
If US News Math > 500 → 500+

Result:

105 now correctly returns Top 150.

My guess is that Glide was probably reading a hidden/underlying value differently from the visible number, which is why it kept returning Top 10.

The Math column with N * 1 fixed it by forcing Glide to read the value as a clean number before applying the If → Then → Else category logic.

Thank you all, and have a wonderful weekend.

The issue with text vs. numerical value is what Jeff suggested: “Interesting. I would assume it’s comparing as text, but I’m not quite understanding the pattern.”

Nice you figured out the issue. Nice approach with *1.