Number of days between dates

ConfusedMum

New Member
Joined
Apr 22, 2013
Messages
7
Office Version
  1. 365
Platform
  1. Windows
Hi all,

I am trying to count the number of days between two days (count to include both the start date AND the end date); however, to complicate things, it might be that the end date cell has a date in it, but the start date is showing as text or that the start date is fine, but that the end date is blank.

So far I have got the formula =IFERROR(DAYS(S2,G2), "Not fully complete")
- where S2 is the end date and G2 is the start date
- however, a few of the G2 cells have the wording in to show they need checking - so text, rather than the date
- and, a few of the S2 cells are blank not having an end date put in as yet

What I am trying to look for is a formula that looks at both S2 and G2 and if S2 is blank OR G2 is text then it returns "Not fully complete". At the moment it is working where G2 is text, but where S2 is blank I am getting -45078 for some reason!!

Any ideas please oh clever Excel minds!

Thanks so much, Cathy :)
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
try:

Excel Formula:
=IF(OR(isnumber(S2)=FALSE,Isnumber(G2)=FALSE),"Not Fully Complete",DAYS(S2,G2))
 
Upvote 1
or:

Excel Formula:
=IF(OR(S2="",G2=""),"Not Fully Complete",DAYS(S2,G2))
 
Upvote 1
Solution
I'm pleased you found a solution in the forum. And welcome to the Mr. Excel Forum.
Thanks for the feedback, and best wishes!
 
Upvote 0
You stated "(count to include both the start date AND the end date)"

Please review Excel's help information for the Days function.
It counts the days between 2 dates.
What result do you require for the following?
I included an alternative that you can try.

T202306a.xlsm
GHIJS
1Days
21-Jan-23455-Jan-23
31-Jan-23303131-Jan-23
41-Jan-2336436531-Dec-23
5
3b
Cell Formulas
RangeFormula
H2:H4H2=IF(OR(ISNUMBER(S2)=FALSE,ISNUMBER(G2)=FALSE),"Not Fully Complete",DAYS(S2,G2))
I2:I4I2=IF(COUNT(G2,S2)=2,S2-G2+1,"Not Fully Complete")
 
Upvote 0

Forum statistics

Threads
1,215,106
Messages
6,123,124
Members
449,097
Latest member
mlckr

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