DATEDIF FORMULA FOR POS/NEG AND OPEN FIELDS

Semperfi4Life83

New Member
Joined
Jan 14, 2022
Messages
6
Office Version
  1. 365
Platform
  1. Windows
I am trying to show the difference in days between two columns and have the return reflect a negative if the date in column "I3" is before the date in column "G3". I have the formula below that returns the number of days for dates in "I3" that are AFTER the date in "G3" and return "OPEN" if no date in "I3".
  • =IFERROR(DATEDIF(G3,I3,"D"),"OPEN")
The image below shows the number as OPEN in the first two lines when it should be a negative as it was closed early

1642172582202.png

Appreciate any help you can offer,

Thanks
 

Attachments

  • 1642172489490.png
    1642172489490.png
    8 KB · Views: 8

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
DATEDIF isn't terribly helpful, when you can use subtraction. It looks like it throws an error when it goes negative.

MrExcelPlayground6.xlsx
GHIJ
31/2/20221/1/2022-1
41/2/2022OPEN
51/2/20221/4/20222
Sheet13
Cell Formulas
RangeFormula
J3:J5J3=IF(I3<>"",I3-G3,"OPEN")
 
Upvote 0
Solution
Hi,

If the start_date is greater than the end_date, the result will be #NUM!

use =days(enddate,startdate)
 
Upvote 0
DATEDIF isn't terribly helpful, when you can use subtraction. It looks like it throws an error when it goes negative.

MrExcelPlayground6.xlsx
GHIJ
31/2/20221/1/2022-1
41/2/2022OPEN
51/2/20221/4/20222
Sheet13
Cell Formulas
RangeFormula
J3:J5J3=IF(I3<>"",I3-G3,"OPEN")

James,
Much appreciated, work perfectly!

James
 
Upvote 0

Forum statistics

Threads
1,214,648
Messages
6,120,725
Members
448,987
Latest member
marion_davis

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