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
-
Apologies, I didn't realise you could do weekend despatches.
Try this instead:-=IF(TEXT(A2,"dd/mm/yyyy")=TEXT(B2,"dd/mm/yyyy"),"Pass",IF(TEXT(A2,"dddd")="Friday",IF(AND(H OUR(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")))
: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 -
Apologies, I didn't realise you could do weekend despatches.
Try this instead:-=IF(TEXT(A2,"dd/mm/yyyy")=TEXT(B2,"dd/mm/yyyy"),"Pass",IF(TEXT(A2,"dddd")="Friday",IF(AND(H OUR(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")))
The following error message is appearing "#NAME?".0 -
I'll have another go at trying to resolve this one - it's very tricky.0
-
-
-
somethingcorporate wrote: »If you look at the quote there is a space in one of the words "H OUR". If you take this out it should resolve the name issue.
That part of the problem is fixed, however if I put down the arrival date as 15/09/12 14:00 and the depatch date as 17/09/12 12:00 it returns a fail, however this should not be the case as the 15th was a Saturday.0 -
Try this in C2:
[FONT=Calibri, sans-serif]=IF(ROUNDDOWN(IF(WEEKDAY(A2)=7,IF(HOUR(A2)<13,A2,(A2)+2),IF(HOUR(A2)<13,A2,(A2)+1)),0)-ROUNDDOWN(B2,0)=0,"Pass","Fail")
You may need to change the < to <= depending on how you treat the 13:00 deadline.
This looks at whether the weekday in question was 7 (Friday) and adds 2 days to the required by date for comparison.
The slight untidy thing about this formula is if you then dispatch it on a Sunday it would fail. I can tidy this up further if you need me to for peripheral logical like that. Just want to check the above works ok first.
FYI the rounddown element of the formula takes out the time from the cells, since we don't care about this for when it is dispatched (only for when it arrives).
[/FONT]Thinking critically since 1996....0 -
somethingcorporate wrote: »Try this in C2:
[FONT=Calibri, sans-serif]=IF(ROUNDDOWN(IF(WEEKDAY(A2)=7,IF(HOUR(A2)<13,A2,(A2)+2),IF(HOUR(A2)<13,A2,(A2)+1)),0)-ROUNDDOWN(B2,0)=0,"Pass","Fail")[/FONT]
[FONT=Calibri, sans-serif]You may need to change the < to <= depending on how you treat the 13:00 deadline.[/FONT]
[FONT=Calibri, sans-serif]This looks at whether the weekday in question was 7 (Friday) and adds 2 days to the required by date for comparison.[/FONT]
[FONT=Calibri, sans-serif]The slight untidy thing about this formula is if you then dispatch it on a Sunday it would fail. I can tidy this up further if you need me to for peripheral logical like that. Just want to check the above works ok first.[/FONT]
[FONT=Calibri, sans-serif]FYI the rounddown element of the formula takes out the time from the cells, since we don't care about this for when it is dispatched (only for when it arrives).[/FONT]
What would be the solution to despatching on a Sunday as this would need to be a pass in ther rare event of this actually happening.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