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

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
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.
 
Upvote 0

Forum statistics

Threads
1,214,830
Messages
6,121,835
Members
449,051
Latest member
excelquestion515

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