Date calculation question

tigger2

New Member
Joined
Apr 22, 2002
Messages
33
I am trying to use a date function in a formula and not sure what I'm doing wrong:

=IF(H11=0,DATE(2004,1,31)-L11,J11)

BAsically the formula says if H11 (response date) is 0, calculate the number of days between today and the due date; otherwise use the value of H11 - the response date.

I tried TODAY, NETWORKDAYS, DATE - I'm sure I"m missing an argument or something but am not very familiar with date functions.

Any ideas would be appreciated.
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.

tigger2

New Member
Joined
Apr 22, 2002
Messages
33
That works - thanks. I see I didn't have the () with TODAY.

Thanks again.
 

gaynard_nelson

Active Member
Joined
Dec 4, 2002
Messages
323
tigger2 said:
I am trying to use a date function in a formula and not sure what I'm doing wrong:

=IF(H11=0,DATE(2004,1,31)-L11,J11)

BAsically the formula says if H11 (response date) is 0, calculate the number of days between today and the due date; otherwise use the value of H11 - the response date.

I tried TODAY, NETWORKDAYS, DATE - I'm sure I"m missing an argument or something but am not very familiar with date functions.

Any ideas would be appreciated.

This works for me. If
H11=15
J11=30
L11=3/1/2004

Then this formula displays

30 as the answer

=IF(H11=0,TODAY()-L11,J11)

Excel will try to format this formulas cell as a date, since it is working with cells that have dates in them. You need to format this formulas cell for General, so it will display the answer in days.
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,151,883
Messages
5,766,926
Members
425,386
Latest member
DougFarley

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
Top