We'd like to remind Forumites to please avoid political debate on the Forum... Read More »
We're aware that some users are experiencing technical issues which the team are working to resolve. See the Community Noticeboard for more info. Thank you for your patience.
📨 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!
Excel 2007 Query
Options
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 -
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
- 350.8K Banking & Borrowing
- 253K Reduce Debt & Boost Income
- 453.5K Spending & Discounts
- 243.8K Work, Benefits & Business
- 598.7K Mortgages, Homes & Bills
- 176.8K Life & Family
- 257.1K Travel & Transport
- 1.5M Hobbies & Leisure
- 16.1K Discuss & Feedback
- 37.6K Read-Only Boards