# 🧮 New Math functions

**URL:** <https://community.glideapps.com/t/new-math-functions/16761>\
**Category:** General\
**Created:** [October 5, 2020, 8:12am UTC](https://community.glideapps.com/t/new-math-functions/16761 "2020-10-05T08:12:00Z")\
**Posts on this page:** 20\
**Page:** 3

<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:** [October 18, 2020, 4:01pm UTC](https://community.glideapps.com/t/new-math-functions/16761/42 "2020-10-18T16:01:11Z")

</div>

Try this:

500\*ROUND(X/500)

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/2X/3/3de32b4751cff2637d625ee5c44e13a8074fdedb.png)

---

<div class="post-metadata">

**Author:** ![Data\_pixel](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/data_pixel/32/11818_2.png) [@Data\_pixel](https://community.glideapps.com/u/Data_pixel)\
**Post date:** [October 18, 2020, 5:03pm UTC](https://community.glideapps.com/t/new-math-functions/16761/43 "2020-10-18T17:03:34Z")

</div>

Hi Glide Team, I agree with @wjcv06 and would also like LEFT, RIGHT and SUBTRING functions ?  
In my case, need to find a workaround to show differents time periods for charts with [https://quickchart.io/](https://quickchart.io/) : data presented as in a stringt list with coma separations !

[Screenshot 2020-10-18 at 19.00.22|245x500](https://community.glideapps.com/uploads/short-url/8N9BqUd8snFeJamI0AyyEdDWgj5.png)

---

<div class="post-metadata">

**Author:** ![manyone](https://avatars.discourse-cdn.com/v4/letter/m/ee59a6/32.png) [@manyone](https://community.glideapps.com/u/manyone)\
**Post date:** [October 19, 2020, 2:08am UTC](https://community.glideapps.com/t/new-math-functions/16761/44 "2020-10-19T02:08:21Z")

</div>

how about a ternary operator like  
predfact=medfact \* (sex='F" ? 1.018 : 1.000)

although i would rather have it as  
predact=medfact \* (if sex=‘F’ then 1.018 else 1.000)  
or  
predfact=medfact\*(if sex=‘F’ then lookupF(age) else lookupM(age))

ie. the values returned by the conditional statement are inline values or variables, or values of functions or other math expressions

---

<div class="post-metadata">

**Author:** ![dinoyonid](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/dinoyonid/32/15385_2.png) [@dinoyonid](https://community.glideapps.com/u/dinoyonid)\
**Post date:** [October 19, 2020, 4:29am UTC](https://community.glideapps.com/t/new-math-functions/16761/45 "2020-10-19T04:29:31Z")

</div>

it works well, thanks!

---

<div class="post-metadata">

**Author:** ![administrasi\_kitsda](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/administrasi_kitsda/32/7240_2.png) [@administrasi\_kitsda](https://community.glideapps.com/u/administrasi_kitsda)\
**Post date:** [October 19, 2020, 11:38pm UTC](https://community.glideapps.com/t/new-math-functions/16761/46 "2020-10-19T23:38:59Z")

</div>

Waiting for countifs and average if for automate counting survey result… 😃

---

<div class="post-metadata">

**Author:** ![Rasha](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/rasha/32/4585_2.png) [@Rasha](https://community.glideapps.com/u/Rasha)\
**Post date:** [October 22, 2020, 9:02pm UTC](https://community.glideapps.com/t/new-math-functions/16761/47 "2020-10-22T21:02:49Z")

</div>

Jeff - I thought this syntax could work for rounding (always) up the current time to nearest 0:30 min using ceiling function. First, tried X as a _now_ math column. Then tried incorporating _now_ within the formula. I’m stumped. Any insight?

---

<div class="post-metadata">

**Author:** ![A.I.Office](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/a.i.office/32/10639_2.png) [@A.I.Office](https://community.glideapps.com/u/A.I.Office)\
**Post date:** [October 23, 2020, 12:14pm UTC](https://community.glideapps.com/t/new-math-functions/16761/48 "2020-10-23T12:14:44Z")

</div>

is it possible to round **up** to exact places after the dot?  
something like from 1.423 to 1.43

---

<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:** [October 23, 2020, 1:15pm UTC](https://community.glideapps.com/t/new-math-functions/16761/49 "2020-10-23T13:15:47Z")

</div>

@administrasi_kitsda Have you looked into using relation, rollup, and math columns to get counts and averages?

@Rasha I spent some time last night trying to come up with a math formula to do that. I feel like I’m close, but I don’t know yet if it’s possible.

@A.I.Office I don’t think you can specify number of decimals, but if you take your value, multiply by 100, Perform a Ceiling on that result, then divide by 100. Should look something like `CEILING(X*100)/100`

---

<div class="post-metadata">

**Author:** ![A.I.Office](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/a.i.office/32/10639_2.png) [@A.I.Office](https://community.glideapps.com/u/A.I.Office)\
**Post date:** [October 23, 2020, 5:27pm UTC](https://community.glideapps.com/t/new-math-functions/16761/50 "2020-10-23T17:27:02Z")

</div>

i’ll try that, thanks 🙂

---

<div class="post-metadata">

**Author:** ![Rasha](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/rasha/32/4585_2.png) [@Rasha](https://community.glideapps.com/u/Rasha)\
**Post date:** [October 23, 2020, 6:58pm UTC](https://community.glideapps.com/t/new-math-functions/16761/51 "2020-10-23T18:58:56Z")

</div>

Appreciate the time you spent on this @Jeff_Hager. I can live without for the time being.

---

<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:** [October 25, 2020, 11:11pm UTC](https://community.glideapps.com/t/new-math-functions/16761/52 "2020-10-25T23:11:29Z")

</div>

@Rasha I think I got it. I feel pretty good about this one. This formula will calculate the time to the next half hour. It does float between 0 and 1 seconds after the minute, but appears to stick on the exact minute of the next half hour and switching to not show seconds will give you a good view. I did watch the time switch from 5:59 to 6:00 and after that, the value changed from 6:00 to 6:30, so I feel pretty good about it.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/2X/f/ff58d73ff4a594c28a1ffe9cadf382d04c6a36b7.png)

The kicker here is that this will require a seed date. This will need to be a column with a date/time. The date and hour can be anything, but the minutes and seconds need to be on the hour, so equal to 0. For example, this is what I have as a seed date/time.  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/2X/8/812df64c3a55cae0f6a80715ba5feb02af842a18.png)

This is the complete math formula:

```auto
X+
(
CEILING(((X-Seed)-ROUND(X-Seed))/.0208333)
-
FLOOR(((X-Seed)-ROUND(X-Seed))/.0208333*1000)/1000
)
/48

```

Hope it works for you.

Edit: This may be better and just a hair more accurate. Basically the same either way.

```auto
X+
(
CEILING(((X-Seed)-ROUND(X-Seed))*48)
-
FLOOR(((X-Seed)-ROUND(X-Seed))*48*1000)/1000
)
/48

```

---

<div class="post-metadata">

**Author:** ![Rasha](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/rasha/32/4585_2.png) [@Rasha](https://community.glideapps.com/u/Rasha)\
**Post date:** [October 26, 2020, 6:18pm UTC](https://community.glideapps.com/t/new-math-functions/16761/53 "2020-10-26T18:18:38Z")

</div>

@Jeff_Hager your help on this one is invaluable - a million thanks! I think the seed column won’t present an obstacle to flow - we’ll see. Will work through this in the coming days and share where I end up.

---

<div class="post-metadata">

**Author:** ![Daniel\_Canup](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/daniel_canup/32/32850_2.png) [@Daniel\_Canup](https://community.glideapps.com/u/Daniel_Canup)\
**Post date:** [October 27, 2020, 3:57pm UTC](https://community.glideapps.com/t/new-math-functions/16761/54 "2020-10-27T15:57:31Z")

</div>

TRUNC(Number, 2)

Is this possible to just TRUNC to a certain decimal point? like does it take two arguments?

---

<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:** [October 27, 2020, 5:30pm UTC](https://community.glideapps.com/t/new-math-functions/16761/55 "2020-10-27T17:30:28Z")

</div>

Looks like only 1 argument. If you want 2 decimal places, just multiply the number by 100, Trunc that result, then divide by 100. I would think Floor would probably do the same thing.

TRUNC(X\*100)/100

---

<div class="post-metadata">

**Author:** ![Daniel\_Canup](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/daniel_canup/32/32850_2.png) [@Daniel\_Canup](https://community.glideapps.com/u/Daniel_Canup)\
**Post date:** [October 28, 2020, 4:37pm UTC](https://community.glideapps.com/t/new-math-functions/16761/56 "2020-10-28T16:37:21Z")

</div>

But what about something like 23.45637?

And I goal is the just and only cut down to 23.45 without it auto rounding.

---

<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:** [October 28, 2020, 4:43pm UTC](https://community.glideapps.com/t/new-math-functions/16761/57 "2020-10-28T16:43:15Z")

</div>

Yep, that’s why you multiply by 100 to move the decimal to the right 2 places, then the Trunc will remove anything to the right of the decimal. Finally the divide by 100 will move the decimal back to it’s original location. Trunc (and Floor) wouldn’t round anything with the formula I gave.

---

<div class="post-metadata">

**Author:** ![Buda\_Queobariu](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/buda_queobariu/32/5351_2.png) [@Buda\_Queobariu](https://community.glideapps.com/u/Buda_Queobariu)\
**Post date:** [October 30, 2020, 11:32am UTC](https://community.glideapps.com/t/new-math-functions/16761/58 "2020-10-30T11:32:22Z")

</div>

Good Morning

@Jeff_Hager, You can call me Buddha (nickname) My name is Franklin. Sorry to bother you, but  
I’m having a problem with a service scheduling app, I’ve been trying for a month and I haven’t found a solution, I’m new to the developer area and I’m not able to do the logic. In this app there are 2 attendants with 10 services and the duration of the hours is 6 different. (ex: service 01 duration 1/4 hour.  
service 5 duration 2h  
service 10 duration 4 h.  
I can put in the hours, but if I select time 10 that lasts 4 hours, I need to make the other services’ schedules disappear … and I don’t know how to do it. these date and time calculations.  
Would you help me?  
I’m from Brazil and I’m using the google translator, forgive if there are any errors …

---

<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 3, 2020, 9:54am UTC](https://community.glideapps.com/t/new-math-functions/16761/59 "2020-11-03T09:54:27Z")

</div>

> [@Mark](#):
>
> What are you using LEFT, RIGHT, SUBSTRING for?

I would use these mostly to fiddle with names. ie. to extract just the given name or family name from a full name. Isn’t always 100% reliable, but avoids having to use multiple columns to store names.

Edit: Actually, having those functions available would solve the problem that I described [here](https://community.glideapps.com/t/customise-inline-list-data-element-font-styles/16839/4) (ie. instead of doing the string manipulation in the GSheet and waiting for it to sync, I could have it done instantly in Glide)

---

<div class="post-metadata">

**Author:** ![SantiagoPerez](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/santiagoperez/32/16807_2.png) [@SantiagoPerez](https://community.glideapps.com/u/SantiagoPerez)\
**Post date:** [November 11, 2020, 4:12pm UTC](https://community.glideapps.com/t/new-math-functions/16761/60 "2020-11-11T16:12:17Z")

</div>

Has this been rolled out?

---

<div class="post-metadata">

**Author:** ![jhkaplan](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jhkaplan/32/22330_2.png) [@jhkaplan](https://community.glideapps.com/u/jhkaplan)\
**Post date:** [March 19, 2021, 8:48pm UTC](https://community.glideapps.com/t/new-math-functions/16761/61 "2021-03-19T20:48:11Z")

</div>

Has there been any update to add math functions like LEFT?

Use case: we’re creating an app to help my wife and I collect and test names for our new baby. I built a feature to concatenate a First + Middle + Last name so we can see how the full name looks. My wife is now asking if we can have some display that shows the initials, ie FIRST MIDDLE LAST would show “FML” (woah…).

My approach to this would be using Left(FIRST,1) + Left(Middle,1), etc… but it doesn’t look like this is possible right now.

[Previous page](https://community.glideapps.com/t/new-math-functions/16761.md?page=2)

[Next page](https://community.glideapps.com/t/new-math-functions/16761.md?page=4)
