# Function

**URL:** <https://community.glideapps.com/t/function/34598>\
**Category:** Ask for Help\
**Created:** [November 16, 2021, 11:34am UTC](https://community.glideapps.com/t/function/34598 "2021-11-16T11:34:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sales\_Manager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/sales_manager/32/16172_2.png) [@Sales\_Manager](https://community.glideapps.com/u/Sales_Manager)\
**Post date:** [November 16, 2021, 11:34am UTC](https://community.glideapps.com/t/function/34598/1 "2021-11-16T11:34:22Z")

</div>

I need to do a calculation in the glide table as follows:

Column A contains : subscribed / unsubscribed

Column B contains : new / old

I need to know how many old subscribers. and how many new subscribers.

What is the formula to know this?

---

<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:** [November 16, 2021, 11:51am UTC](https://community.glideapps.com/t/function/34598/2 "2021-11-16T11:51:33Z")

</div>

You could do that as follows:

- Create an if-then-else column  
– If Column A is not subscribed, then empty  
– If Column B is new, then true  
– Else false
- To get a count of new subscribers, create a rollup column that counts the number of true values in the if-then-else column
- To get a count of old subscribers, create a rollup column that counts the number of false values in the if-then-else column

The above takes advantage of the fact that a Glide boolean can have 3 states: empty, true, false

- Not subscribed: empty
- Subscribed and new: true
- Subscribed and old: false

_Update_: I just tested that quickly and it doesn’t work. There seems to have been a change in behaviour where an empty boolean value is being treated as false. Therefore, a 4th column is needed.

- 1st if-then-else:  
– If Column A is not subscribed, then empty  
– If Column B is new, then true
- 2nd if-then-else  
– If Column A is not subscribed, then empty  
– If Column B is old, then true
- 1st Rollup  
– Count true values of 1st if-then-else
- 2nd Rollup  
– Count true values of 2nd if-then-else

 ![Screen Shot 2021-11-16 at 8.05.36 PM](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/6/1/6101a06e9b289fd52faba14a337f92d06d05abfe.png)

---

<div class="post-metadata">

**Author:** ![Sales\_Manager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/sales_manager/32/16172_2.png) [@Sales\_Manager](https://community.glideapps.com/u/Sales_Manager)\
**Post date:** [November 16, 2021, 1:39pm UTC](https://community.glideapps.com/t/function/34598/3 "2021-11-16T13:39:17Z")

</div>

Thank you very much, I benefited from this  
Thank you again
