Date Subtract

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="class: cms_table, width: 500"]
<tbody>[TR]
[TD][/TD]
[TD="align: center"]N[/TD]
[TD="align: center"]O[/TD]
[TD="align: center"]P[/TD]
[TD="align: center"]Q[/TD]
[TD="align: center"]R[/TD]
[TD="align: center"]S[/TD]
[TD="align: center"]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

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
Totally confused?!How could you possibly referance to the source cell on the first hand?
 
Upvote 0
The formula in T4 must probably refer to S4, not to T4... If this is right:

In T4 enter an copy down...

=IF(O4="","",IF(ISNUMBER(S4),S4-O4,TODAY()-O4))
 
Upvote 0

Forum statistics

Threads
1,224,922
Messages
6,181,777
Members
453,065
Latest member
jfrsanders

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