Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Worksheet Functions / June 2006

Tip: Looking for answers? Try searching our database.

Formula for calcing dates

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Pandora - 17 Jun 2006 17:55 GMT
Hiya,

The spreadsheet I need function help on is to be used to flag end dates for
plant hire. We need to know when a piece of plant is over 2 weeks on hire to
keep track of where stuff is and what is available. I have used the following:
=IF(ISBLANK(B2),TODAY()-A2,"") this gives number of days from start of hire
and we can put in conditional formatting to flag up after  X no. of days.

where b2 = booked until date
and a2 = start of hire

Problem is that there is another field that indicates actual hire end date
and I also need to use this so that if c2 = actual end of hire then the
formula cals no of days actual hire.

Hope this makes sense!

Many thanks
Signature

Pandora

Bob Phillips - 17 Jun 2006 18:22 GMT
What is the difference between 'booked until date' and 'actual end of hire
date'?

And what do you want to know about them?

Or is simply

=IF(AND(ISBLANK(B2),ISBLANK(C2)),TODAY()-A2,"")

--

HTH

Bob Phillips

(replace xxxx in the email address with gmail if mailing direct)

> Hiya,
>
[quoted text clipped - 16 lines]
> --
> Pandora
Pandora - 17 Jun 2006 19:00 GMT
My problem is that I am trying to set up a spreadsheet that wiil be used by
different groups of people who historically have recored data in different
ways. I would have just put start of hire A and end of hire C. Then it would
have been if B is blank use today function to calc how many days item has
been on hire or if there is an end date then subtract A from C to indicate
no. of days item hired for. But one team records a 'hired until date'  B
useful except for the fact that more often than not hires run over this date.
That team won't fill in C if there is a date in B! Arghh! So what I need to
know is
1. if there is a start date A only - How many days hire using today func
2. if there is a start date A and end of hire C - how many days hire
3. if there is a start date A and hired until date B - how many days
"expected hire"
4. If there is a start date A and hired until date B AND end of hire C How
many days actual hire i.e Cminus A.

Now I have written it out it looks even more complicated than I first thought!
I know I can't get the teams to change the dates they record and the
majority of them are anti-technology anyway. Attitude is 'why do we need
this? We always know exactly what's out and for how long.'

I'm only the person who's been told to set up a spreadsheet with flagged
dates on it!!!! Not trying to buck the culture, honest!  

After getting on my soapbox, I would be very grateful for any help

Many thanks
Signature

Pandora

> What is the difference between 'booked until date' and 'actual end of hire
> date'?
[quoted text clipped - 37 lines]
> > --
> > Pandora
VBA Noob - 17 Jun 2006 21:26 GMT
Hi Pandora,

I think this works

=IF(AND(B2="",C2="",A2=""),"",IF((AND(B2="",C2="",A2<>"")),TODAY()-A2+1,IF(AND(A2<>"",C2<>"",B2=""),C2-A2+1,IF(AND(A2<>"",B2<>"",C2=""),B2-A2+1,IF(AND(A2<>"",B2<>"",C2<>""),C2-A2+1)))))

It's basically nested If statements that read that comes back with a
true or flase statement e,g

To help you read it examine what the first part is doing

IF(AND(B2="",C2="",A2=""),"",

It checks to see if A2, B2 and C2 are all blank, If they are it comes
back blank and so

Hope this helps

VBA Noob

Signature

VBA Noob

Pandora - 18 Jun 2006 14:53 GMT
Fantastic!!!! I really can't say how grateful I am, really!
Signature

Pandora

> Hi Pandora,
>
[quoted text clipped - 15 lines]
>
> VBA Noob
Bob Phillips - 17 Jun 2006 22:08 GMT
=IF(AND(B2="",C2=""),TODAY()-A2,IF(C2<>"",C2-A2,B2-A2))

--

HTH

Bob Phillips

(replace xxxx in the email address with gmail if mailing direct)

> My problem is that I am trying to set up a spreadsheet that wiil be used by
> different groups of people who historically have recored data in different
[quoted text clipped - 67 lines]
> > > --
> > > Pandora
VBA Noob - 17 Jun 2006 22:28 GMT
Hi Bob,

If say the hire was made today 17th June and returned today then your
formula would return 0.

Also if the start date is blank it still returns a value so I suggest
the following

=IF(AND(A2="",B2="",C2=""),"",IF(AND(B2="",C2=""),TODAY()-A2+1,IF(C2<>"",C2-A2+1,B2-A2+1)))

VBA Noob

Signature

VBA Noob

Pandora - 18 Jun 2006 14:55 GMT
Thank you so much!!! I really appreciate the trouble you guys go to to answer
queries here. Thank you!!!!
Signature

Pandora

> =IF(AND(B2="",C2=""),TODAY()-A2,IF(C2<>"",C2-A2,B2-A2))
>
[quoted text clipped - 88 lines]
> > > > --
> > > > Pandora
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.