Differnce between two dates

H

housinglad

Hi

I want to dermine how mnay days there is between cell c6 and g6 if g6
contains a value, if not then i want thee code to do nothjing.

Mnay thanks
 
M

Ms-Exl-Learner

You didn't mention which is the Start Date and which one is end date (i.e.)
whether the start date is C6 Or G6.

If the Start Date is C6 and the End Date is G6 then use the below formula
=IF(G6="","",DATEDIF(C6,G6,"D"))

If the Start Date is G6 and the End Date is C6 then use the below formula
=IF(G6="","",DATEDIF(G6,C6,"D"))

Remember to Click Yes, if this post helps!
 
R

Ron Coderre

housinglad;636895 said:
Hi

I want to dermine how mnay days there is between cell c6 and g6 if g6
contains a value, if not then i want thee code to do nothjing.

Mnay thanks

Try something like this:
=IF(G6>0,G6-C6,"")

Is that something you can work with
 
H

housinglad

Sorry can you state how I would do this to dermine working days.

Cheers
Dan

Ron Coderre said:
housinglad;636895 said:
Hi

I want to dermine how mnay days there is between cell c6 and g6 if g6
contains a value, if not then i want thee code to do nothjing.

Mnay thanks

Try something like this:
=IF(G6>0,G6-C6,"")

Is that something you can work with?


--
Ron Coderre
------------------------------------------------------------------------
Ron Coderre's Profile: 1451
View this thread: http://www.thecodecage.com/forumz/showthread.php?t=177359

Microsoft Office Help

.
 
R

Ron Coderre

Optimally, you would use the NETWORKDAYS function.
In XL2007, that function is native.
Pre-XL2007, you'll need to engage the Analysis ToolPak add-in.

Typical usage:
=NETWORKDAYS(StartDate,EndDate)

However, it can also skip holidays if you provide a list.
See Excel help for more instructions on using that function.

Does that help
 
H

housinglad

anyone??

Just to clarify I want to determine the number of working days (cell C5 &
E5) only if cell E5 contains sum data.

Thanks
Dan
 
H

housinglad

Not really, so what would the function be for 2007 version?

At the moment I have:

=IF(ISBLANK(G6),"",G6-E6)

But that just calculates days not working days.

Thanks
Dan
 
R

Ron Coderre

I'm curious....
How is it that a function whose only purpose is to calculate the number of
workdays
between two dates cannot help you calculate the number of workdays between
two dates?

If the NETWORKDAYS function does, in fact do what you want,
try something like this:
=IF(ISBLANK(G6),"",NETWORKDAYS(E6,G6))

Does that help?
***********
Regards,
Ron

XL2003, XL2007
 
Top