Number of days between 2 dates

ExcelFanatic

Board Regular
Joined
May 22, 2009
Messages
83
In my spreadsheet columns L through O contain dates:
L - Planned Start Date
M - Actual Start Date
N - Planned End Date
O - Actual End Date

In column Q I am looking for the number of days between the start and end date using the following formula:

If the column M is blank, I want to use the date in column L,
If column O is blank, I want to use the date in column N

=IF(M7190="",L7190,M7191)-IF(O7190="",N7190,O7190)

My formula is not working.
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
Try doing the subtraction the other way round, i.e.

=IF(O7190="",N7190,O7190)-IF(M7190="",L7190,M7191)

format result cell as general
 
Upvote 0
is it giving you an error, or are the results different than what you expected? What are the values in the cells in the example you posted?
 
Upvote 0
Thanks for the help. reversing the order worked. Should have picked that out since it is a subtraction problem. I wasn't looking at my formula and seeing it.
 
Upvote 0

Forum statistics

Threads
1,213,546
Messages
6,114,256
Members
448,557
Latest member
richa mishra

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