Subtracting 2 dates but check cells if blank

raburger

New Member
Joined
Oct 18, 2017
Messages
4
Hi,

I need help. I want to subtract 2 columns from each other (Dates) but the cells need to be checked fist if blank and if blank it should ignore the one or use Today() in the other.

Example below. Row 4 and 5 work but row 6 gives me a 43027 value that should be a blank as I get the average delay in T so a 0 cant be entered if both cells are empty.

[TABLE="width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]N[/TD]
[TD]O[/TD]
[TD]P[/TD]
[TD]Q[/TD]
[TD]R[/TD]
[TD]S[/TD]
[TD]T[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Rev[/TD]
[TD]Sub Date[/TD]
[TD]App[/TD]
[TD]APP Wc[/TD]
[TD]Rej[/TD]
[TD]Resp Date[/TD]
[TD]Review Delay
[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]a[/TD]
[TD]20/01/2017[/TD]
[TD]1[/TD]
[TD][/TD]
[TD][/TD]
[TD]28/01/2017[/TD]
[TD]=IF(T4="",TODAY()-O4,T4-O4)[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]a[/TD]
[TD]23/01/2017[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]=IF(T5="",TODAY()-O5,T5-O5)[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]a[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]
[/TD]
[TD]=IF(T6="",TODAY()-O6,T6-O6)[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
Maybe this if im reading correctly:

=IF(O4="","",IF(S4="",TODAY(),S4)-O4)
 
Upvote 0
Maybe this if im reading correctly:

=IF(O4="","",IF(S4="",TODAY(),S4)-O4)



Thank you for the reply but it is not working. It leave the calculation cell blank when both cells are Blank(correct) but it doesn't calculate if one cell have a date in. So it must give a count with "today()" if one date is not completed but blank if both are blank.

Background:

This is for document control. We receive a document(first date) and then respond(second date). this is done on numerous revisions and we track both review time(Owner) and revision time(Contractor).
 
Upvote 0
It will leave a blank if both cells are blank. It will use today if the cell in S is blank. By what you are saying it cant be possible for O to be blank but S to have a date present. So in what way doesnt it work?
 
Upvote 0
It will leave a blank if both cells are blank. It will use today if the cell in S is blank. By what you are saying it cant be possible for O to be blank but S to have a date present. So in what way doesnt it work?

O will have a date before S. This if both cells are blank T must be blank but if O have a date and S not it must use Today() to calculate the delay.
 
Upvote 0

Forum statistics

Threads
1,224,825
Messages
6,181,190
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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