Calculating days between two dates where one cell is empty

Dan012

New Member
Joined
Jun 25, 2011
Messages
9
Hi everyone' I am trying to calculate the number of days between two dates (a start and an end date) and also where if the end date is left blank it calculates today as the end date.

This is to calculate the number of days on market for a product.

Eg. Cell A5 is the start date, cell B5 is the end date of the event I.e sold. (The end date may not be filled in as yet if the product is not yet sold). Cell C5 is the answer with total number of the products days on the market including if it still for sale e.g 54 days on market.

So I need a formula that will calculate the number of days between A&
B column if they are completed and also assume that cell B5 is today's date if it is left blank.

Any help will be greatly appreciated.
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
Thanks for the reply,

When I entered the formula using these dates as a test I got the correct result when both dates were entered, I.e start date 23/6/2011 & end date 25/06/2011 it responded the correct answer (2)

On the second line same start date. I left the end date blank I returned a result of 40719 in stead of (2).

Not sure if I have made a mistake

Thanks heaps for taking the time to respond
 
Upvote 0
Format that column as "DATE" and will show corect answer

That would show today's date, not the correct answer.

try

=IF(B5>0,TODAY(),B5)-A5

if you have a cell on the sheet that already shows today, then use that in the formula in place of the TODAY() function.
 
Upvote 0
I answer to this:

"On the second line same start date. I left the end date blank I returned a result of 40719 in stead of (2)."

@jasonb75
your formula don't work
 
Last edited:
Upvote 0
I answer to this:

On the second line same start date. I left the end date blank I returned a result of 40719 in stead of (2).

then you didn't answer it very well, 40719 formatted as date would show "25/06/2011" or similar depending on your regional format, that looks nothing like the correct answer of (2)
 
Upvote 0
thanks for everyone's efforts to help me. Unfortunately I still can't get this formula to work. Any other suggestions that may help?
 
Upvote 0

Forum statistics

Threads
1,224,597
Messages
6,179,808
Members
452,944
Latest member
2558216095

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