We’d like to remind Forumites to please avoid political debate on the Forum.
This is to keep it a safe and useful space for MoneySaving discussions. Threads that are – or become – political in nature may be removed in line with the Forum’s rules. Thank you for your understanding.
📨 Have you signed up to the Forum's new Email Digest yet? Get a selection of trending threads sent straight to your inbox daily, weekly or monthly!
The Forum now has a brand new text editor, adding a bunch of handy features to use when creating posts. Read more in our how-to guide
Excel 2007 Query
Comments
-
somethingcorporate wrote: »I will give it some thought. Have you tried the rest of the code?
Weekends are still a problem, if I input Friday 14/09/12 at 14:00 as the arrival time and Monday 17/09/12 at 14:00 as the despatch time it returns a failed when this should be a pass.0 -
I didn't realise that should be a pass, I assumed if it was Friday then it would need to be Saturday to pass. I can build it in.
I will look at it again tonight, quite a few little quirks that make this complex!Thinking critically since 1996....0 -
somethingcorporate wrote: »I didn't realise that should be a pass, I assumed if it was Friday then it would need to be Saturday to pass. I can build it in.
I will look at it again tonight, quite a few little quirks that make this complex!
Thanks for that, everytime I think I have it solved another problem arises but basically anything that arrives after 13:00 on a Friday should be a pass if despatched on the following Monday.0 -
Yep, that is not too complicated (just something that I had not picked up from everyone elses' code in the thread).Thinking critically since 1996....0
-
I'm still at a loss to know what's wrong with my earlier simple solution, it does precisely that! This really is a trivial problem, that should only take a few minutes to code.Thanks for that, everytime I think I have it solved another problem arises but basically anything that arrives after 13:00 on a Friday should be a pass if despatched on the following Monday.Stompa0 -
I'm still at a loss to know what's wrong with my earlier simple solution, it does precisely that! This really is a trivial problem, that should only take a few minutes to code.
I tried this solution, appears to do the trick.
Not sure why the OP missed it first time around, it's very elegant compared to mine (which only partially works). :TThinking critically since 1996....0 -
I don't know about elegant, but given that Excel has functions to manipulate dates and times it seems to make sense to use them!somethingcorporate wrote: »Not sure why the OP missed it first time around, it's very elegant compared to mine (which only partially works). :TStompa0 -
Just testing the following code out at a different PC (this has Excel 2010 on it) and the following code brings up the #NAME? error message.
=IF(dayout<1+WORKDAY(dayin,1-(HOUR(dayin)<13)),"Pass","Fail")0 -
Yes, you need to substitute 'dayin' and 'dayout' with the actual cells containing your dates, for example:Just testing the following code out at a different PC (this has Excel 2010 on it) and the following code brings up the #NAME? error message.
=IF(dayout<1+WORKDAY(dayin,1-(HOUR(dayin)<13)),"Pass","Fail")
=IF(B2<1+WORKDAY(A2,1-(HOUR(A2)<13)),"Pass","Fail")Stompa0 -
This discussion has been closed.
Confirm your email address to Create Threads and Reply
Categories
- All Categories
- 353.5K Banking & Borrowing
- 254.1K Reduce Debt & Boost Income
- 455K Spending & Discounts
- 246.6K Work, Benefits & Business
- 602.9K Mortgages, Homes & Bills
- 178K Life & Family
- 260.5K Travel & Transport
- 1.5M Hobbies & Leisure
- 16K Discuss & Feedback
- 37.7K Read-Only Boards