# 🤔 How to: Use If-Then-Else to calculate formulas based on text in another column (w/pic)

**URL:** <https://community.glideapps.com/t/how-to-use-if-then-else-to-calculate-formulas-based-on-text-in-another-column-w-pic/66017>\
**Category:** Ask for Help\
**Created:** [September 12, 2023, 1:08am UTC](https://community.glideapps.com/t/how-to-use-if-then-else-to-calculate-formulas-based-on-text-in-another-column-w-pic/66017 "2023-09-12T01:08:32Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![JamieErvin](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jamieervin/32/57900_2.png) [@JamieErvin](https://community.glideapps.com/u/JamieErvin)\
**Post date:** [September 12, 2023, 1:08am UTC](https://community.glideapps.com/t/how-to-use-if-then-else-to-calculate-formulas-based-on-text-in-another-column-w-pic/66017/1 "2023-09-12T01:08:32Z")

</div>

![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/4/8/48f60d9aba78586d6ccc4d9345f001e2c27dffd7.png)  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/f/9/f99dc0b06cd2aa94ce5c83780aa732fe43289664.png)

In order to get a new Trade Price column to use a calculation based on the Spread Type, what is the correct syntax to use?

Thanks

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [September 12, 2023, 1:12am UTC](https://community.glideapps.com/t/how-to-use-if-then-else-to-calculate-formulas-based-on-text-in-another-column-w-pic/66017/2 "2023-09-12T01:12:36Z")

</div>

Create a Math column for each potential calculation. Then use the IF column to return the correct math column value based on the spread type.

---

<div class="post-metadata">

**Author:** ![JamieErvin](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jamieervin/32/57900_2.png) [@JamieErvin](https://community.glideapps.com/u/JamieErvin)\
**Post date:** [September 12, 2023, 1:14am UTC](https://community.glideapps.com/t/how-to-use-if-then-else-to-calculate-formulas-based-on-text-in-another-column-w-pic/66017/3 "2023-09-12T01:14:16Z")

</div>

Thank for the reply. So to be clear on my end, what I am trying to do can’t be done the way I am describing, correct?

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [September 12, 2023, 1:16am UTC](https://community.glideapps.com/t/how-to-use-if-then-else-to-calculate-formulas-based-on-text-in-another-column-w-pic/66017/4 "2023-09-12T01:16:38Z")

</div>

No. You cannot do math inside of an IF column.

---

<div class="post-metadata">

**Author:** ![JamieErvin](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jamieervin/32/57900_2.png) [@JamieErvin](https://community.glideapps.com/u/JamieErvin)\
**Post date:** [September 12, 2023, 2:11am UTC](https://community.glideapps.com/t/how-to-use-if-then-else-to-calculate-formulas-based-on-text-in-another-column-w-pic/66017/5 "2023-09-12T02:11:34Z")

</div>

Understood. Thanks again!
