How to Calculate the Number of Days Between Two Dates

Goal

Calculate the number of days between 2 dates.

Learn

I have a sheet with two date columns, A and B, whereby A is the FromDate and B is the ToDate. The date column B may be BLANK or EMPTY, as the end date may not defined yet. The formula shall calculate the days only IF the end date column IS NOT BLANK (OR EMPTY), otherwise return BLANK. 

=IF(NOT(ISBLANK(#DateSheet!FromDate));((#DateSheet!ToDate-#DateSheet!FromDate)/1d);null)