Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Date difference calculation

Featured Replies

Excel and Filemaker calculates the difference between two dates differently. I always thought that when you subtract two date from one another, the result was the number of full days between the dates.

For example:  Calculate the difference between 1/15/19 – 1/9/19.

There are 5 full days between these dates (10th, 11th, 12th, 13th, and 14th). However, FM and Excel calculations do not result in 5, and they don’t even agree with each other!

In Excel, Difference = 7

In FM, Difference = 6

It seems that when you subtract two dates in Excel the result includes the starting and ending dates and therefore it is not the number full days between the dates. In FM the result seems to include either the starting or ending date (not both), and therefore it also is not the number of full days between the dates.

What gives?

What formula are you using in Excel to calculate the difference? 

Filemaker simply converts both dates to serial numbers, starting with the date 1/1/0001 being the first day, then subtracts the two numbers. AFAIK, Excel's DATEDIF() function works in a similar fashion and returns the same result. I don't have Excel installed, but I get the same result in LibreOffice by just subtracting the two dates and formatting the result as number.

 

58 minutes ago, john9210 said:

There are 5 full days between these dates

The logic that Filemaker (and, I believe, Excel as well as most of us) applies here is this:

  • the difference between today and today is 0 elapsed days;
  • the difference between yesterday and today is 1 elapsed day;

  • the difference between last Sunday and this Sunday is 7 elapsed days; 

  • etc.

Your logic would have the difference between today and today as -1 elapsed days.

 

 

 

Edited by comment

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.