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
-
Try this:
=IF(TEXT(A2,"dd/mm/yyyy")=TEXT(B2,"dd/mm/yyyy"),"Pass",IF(TEXT(A2,"dddd")="Friday",IF(AND(HOUR(A2)>=13,TEXT(B2,"dd/mm/yyyy")=TEXT(A2+3,"dd/mm/yyyy")),"Pass","Fail"),IF(AND(HOUR(A2)>=13,TEXT(B2,"dd/mm/yyyy")=TEXT(A2+1,"dd/mm/yyyy")),"Pass","Fail")))
Similar to the first one but now takes the arrival day into account.
Seems to work at a quick check.:wall: Flagellation, necrophilia and bestiality - Am I flogging a dead horse? :wall:
Any posts are my opinion and only that. Please read at your own risk.0 -
Just to reassure you OP, business rules around dates are responsible for about half of the work in IT - it is always more complicated than it sounds! For instance when people want a stock list and a sales list and try to combine them, with some sort of tests for date ranges... Well it throws up about a zillion things you're touching the edges of! So be assured, it's not you being dumb, but surprisingly complicated!0
-
It seems to me that something like:
=IF(dayout<1+WORKDAY(dayin,1-(HOUR(dayin)<13)),"Pass","Fail")
should do the trick.Stompa0 -
Try this:
=IF(TEXT(A2,"dd/mm/yyyy")=TEXT(B2,"dd/mm/yyyy"),"Pass",IF(TEXT(A2,"dddd")="Friday",IF(AND(HOUR(A2)>=13,TEXT(B2,"dd/mm/yyyy")=TEXT(A2+3,"dd/mm/yyyy")),"Pass","Fail"),IF(AND(HOUR(A2)>=13,TEXT(B2,"dd/mm/yyyy")=TEXT(A2+1,"dd/mm/yyyy")),"Pass","Fail")))
Similar to the first one but now takes the arrival day into account.
Seems to work at a quick check.
Thanks again, I've tried your code above but it return a parenthesis error which I can't resolve, do you know what the problem could be? I've removed all additional code that I had within the cell and it still doesn't seem to work.0 -
Thanks again, I've tried your code above but it return a parenthesis error which I can't resolve, do you know what the problem could be? I've removed all additional code that I had within the cell and it still doesn't seem to work.
Thought I'd bump this up again as it's been bugging me all day.0 -
Thanks again, I've tried your code above but it return a parenthesis error which I can't resolve, do you know what the problem could be? I've removed all additional code that I had within the cell and it still doesn't seem to work.
I've just copied the formula direectly into a cell and it works fine for me.
Are you sure you grabbed all of the formula?:wall: Flagellation, necrophilia and bestiality - Am I flogging a dead horse? :wall:
Any posts are my opinion and only that. Please read at your own risk.0 -
It doesn't seem to recognise Fridays, at present if I put in the arrival date as 07/09/2012 14:00 and the despatch date as 08/09/2012 12:00 it is returning fail when this should be pass.
I've copied across the code 3 times now to no avail.0 -
I may be wrong, but I don't think that formula accommodates despatch dates that happen to be a Saturday or Sunday. I'd go with the simpler:It doesn't seem to recognise Fridays, at present if I put in the arrival date as 07/09/2012 14:00 and the despatch date as 08/09/2012 12:00 it is returning fail when this should be pass.
I've copied across the code 3 times now to no avail.
=IF(B2<1+WORKDAY(A2,1-(HOUR(A2)<13)),"Pass","Fail")
which I think should work in all circumstances.Stompa0 -
I'm still not getting anywhere with these formulas, does anyone know how to combine the formulas to allow for weekends etc?0
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