network days in formula (Excel 2003 SP3)

steveh
SilverLounger
Posts: 1952
Joined: 26 Jan 2010, 12:46
Location: Nr. Heathrow Airport

network days in formula (Excel 2003 SP3)

Post by steveh »

Afternoon all

I have attached a sample spreadsheet in which delays are calculated based on the departure date and time and the arrival date and time which calculates the transit based on the expected trasnit time and the actual time taken (the results are in the delay column)

I am wondering if I could add a formula into another column to recognise if the expected transit time was 48 hours and the departure day was a Thursday or a Friday 48 hours has to be added to the transit, if the transit time is 24 hours and the departure day is Friday add 48 hours.

It seems an impossible ask to me but I know that you formula guys might be able to prove me wrong.
You do not have the required permissions to view the files attached to this post.
Steve
http://www.freightpro-uk.com" onclick="window.open(this.href);return false;
“Tell me and I forget, teach me and I may remember, involve me and I learn.”
― Benjamin Franklin

User avatar
HansV
Administrator
Posts: 78536
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: network days in formula (Excel 2003 SP3)

Post by HansV »

The extra transit time for row 4 would be

=(WEEKDAY(E4)>=5)*(WEEKDAY(E4)<=6)*(I4=48)*48+(WEEKDAY(E4)=6)*(I4=24)*48

If you want to add the expected transit time and the extra transit time together, use

=I4+(WEEKDAY(E4)>=5)*(WEEKDAY(E4)<=6)*(I4=48)*48+(WEEKDAY(E4)=6)*(I4=24)*48
Best wishes,
Hans

steveh
SilverLounger
Posts: 1952
Joined: 26 Jan 2010, 12:46
Location: Nr. Heathrow Airport

Re: network days in formula (Excel 2003 SP3)

Post by steveh »

HansV wrote:The extra transit time for row 4 would be

=(WEEKDAY(E4)>=5)*(WEEKDAY(E4)<=6)*(I4=48)*48+(WEEKDAY(E4)=6)*(I4=24)*48

If you want to add the expected transit time and the extra transit time together, use

=I4+(WEEKDAY(E4)>=5)*(WEEKDAY(E4)<=6)*(I4=48)*48+(WEEKDAY(E4)=6)*(I4=24)*48
Hi Hans

That is absolutely brilliant, thank you very much, I really did think that this would be impossible to do. When you have a moment could you please let me know what 14 is in the formula and what it does, for example 14=48?

Also in recognition of your MVP status your sig should surely be HansmVp now :grin:
Steve
http://www.freightpro-uk.com" onclick="window.open(this.href);return false;
“Tell me and I forget, teach me and I may remember, involve me and I learn.”
― Benjamin Franklin

User avatar
StuartR
Administrator
Posts: 12615
Joined: 16 Jan 2010, 15:49
Location: London, Europe

Re: network days in formula (Excel 2003 SP3)

Post by StuartR »

steveh wrote:...When you have a moment could you please let me know what 14 is in the formula and what it does, for example 14=48?
...
Steve,

This is not (14=48), the first character is letter I, not digit 1, it references column I of row 4 of the Worksheet.
StuartR


User avatar
HansV
Administrator
Posts: 78536
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: network days in formula (Excel 2003 SP3)

Post by HansV »

As Stuart says, it's I4 - the cell in row 4 containing the expected transit time.
Best wishes,
Hans

steveh
SilverLounger
Posts: 1952
Joined: 26 Jan 2010, 12:46
Location: Nr. Heathrow Airport

Re: network days in formula (Excel 2003 SP3)

Post by steveh »

HansV wrote:As Stuart says, it's I4 - the cell in row 4 containing the expected transit time.
Thanks Hans and Stuart

Can somebody design a Homer smilie smacking his head and saying doh!!
Steve
http://www.freightpro-uk.com" onclick="window.open(this.href);return false;
“Tell me and I forget, teach me and I may remember, involve me and I learn.”
― Benjamin Franklin