Date Diff Formula

gheyman

Well-known Member
Joined
Nov 14, 2005
Messages
2,347
Office Version
  1. 365
Platform
  1. Windows
In a table I need to calculate the Numbers of days between two Fields (ActualStart, ActualFinish)

These two are fields are in this same table.

I assume its a DateDif
 
Thanks Joe.

I did add a the unbound for the Date difference and it works. But what happened when I have a Field for Actual finish date which I want a default date until the user enters one. The default would be the Actual start date plus that unbound number (number of planned days)? Where and how do I do that? is it not in an "Actual Finish" field under default?
 
Upvote 0

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
Are you saying what to do when the Actual Finish Date is not populated?
You can use the NZ function to tell it what to use (as a default) if the field is blank.
For example, the following formula subtracts StartDate from EndDate, but if EndDate is null (empty), it uses the current date as the default.
Code:
Nz([StartDate],Date())-[EndDate]
See here for a complete explanation on the Nz function: https://www.techonthenet.com/access/functions/advanced/nz.php
 
Last edited:
Upvote 0
Thanks, but I'm still not getting it.

The field Name is "Actual Start Date". Its a Date field that the user will eventually update. But until he does the field should have a default value. I want the default value be the result of a formula. Is this possible?
 
Upvote 0
I don't think you can use formulas as the default values of date fields in a table (though you can use the current date; see: https://support.office.com/en-us/ar...rols-99508d03-b28b-4057-9652-dac1c4c60d86#bm5). However, you can apply your formula logic when you do your calculations. Just use the Nz function like I showed, and put your formula in the second argument of the Nz function. If you look at that link I sent, that last sentence should make sense.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,221,771
Messages
6,161,847
Members
451,723
Latest member
Rachetsely

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top