# Calculating Last Date from 2 dates

Hi hi

I need to calculate the last date of the Probation Period from a Final Start Date in which:

1. Final Start Date will be the Latter of Scheduled Start Date and Actual Start Date (whichever is later), and I have use the If-Else to check. See Show Final Start Date is a If Else Formula.jpg

2. I would like to find the Probation Last Date by getting the Final Start Date + Probation Period (in days).

Issue:

• When i use the Math method using Final Start Date (If Else Then) + Probation period (in days), there is no results.

• However if i use the Maths method using Schedule Start Date (a date field) + Probation period (in days), there is a rightly result.

Works for me.

I notice that youâ€™re using an if-then-else column for your probation period. Are you sure that always returns a number?

2 Likes

Guess this was a case that the author did not give a value for the â€śelseâ€ť branch. That might mess things up when doing a calculation in the math column.

mmm, thatâ€™s the only thing that occurred to me. Either that, or maybe the Actual Start Date isnâ€™t a â€śtrueâ€ť date/time column. If itâ€™s coming from a Google Sheet, that could be a possibility. Although, the fact that â€śis afterâ€ť is available in the if-then-else suggests that itâ€™s okayâ€¦

1 Like

Hi hi thanks for your quick response!

Probation will always have a value. See this.

HI hi

Similarly, the final start date will always show the date as the user will need to key in a date for the schedule start date. See this screenshot.

I have checked again. My side still showing nothing when use show_Final Start Date.

Hi hi

Actual Start date is a Date in Glidetable

Can you try removing the extra line in the â€ś90â€ť value to see if it makes a difference?

@Darren_Murphy I have constructed the same as yours.

@ThinhDinh Remove 90.

May we know what type of browser are you using, and what format are you using for your â€śscheduled start dateâ€ť column in your Google Sheets?

I assume itâ€™s the same â€ś1 Sep 22â€ť weâ€™re seeing?

Does it work if you click on the arrow button on the right of the column name?

Hi

I am using CHrome browser in windows.

Will it matter if i have update the Actual Start date from a New screen instead of the generic Edit Screen

It doesnâ€™t matter. I was just wondering what format is it writing under the hood, whether you manually input it or is it a Glide component. Seems like itâ€™s just the date component writing to that column?

Are there any other columns that handle those dates that we arenâ€™t seeing?
Specifically - do you use any of the date related plugin columns anywhere?

Using the Glide component Date Picker

Okay, I just noticed something. In your if-then-else column that determines the â€śfinal startâ€ť date, it looks like Glide sees the result as a number rather than a date. You can tell this because itâ€™s asking you to set a number precision rather than a date format. See belowâ€¦

I donâ€™t know why this is, but I think itâ€™s a clueâ€¦

Hi

No. not using any plugin actually. Purely Google sheet and glidetables. I am still a novice in this

Just resort to using google sheet arrayformula on this

Would you be prepared to give me temporary access to your team so that I can take a look?

If thatâ€™s okay, send me a private message with the team invite link (you can get that from the team members list on your dashboard).

Hi hi

Have to choose of the value. SO i choose 1. Still the same.

Sure! Let me insert you. Pm

Yeah, my point is that the fact that itâ€™s asking to to set the precision means that the result is a number. But it should be a date. My gut feeling is that there is something wrong with your Actual Start Date column. Try changing the format of that column and then save it again. Set it to date and time, or long date format, or anything different to what it is now. See if that changes anything.