View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.newusers
Bob Phillips Bob Phillips is offline
external usenet poster
 
Posts: 10,593
Default WORKDAY() and probably more


"Epinn" wrote in message
...
Bob,

Sorry, I disappointed you. <g I am glad that I didn't spend hours
trying to analyze what they put on the web site. May be the info there
is not so reliable after all??



The problem was that it was testing the last day for Friday or Sunday, it
should be testing for Saturday or Sunday.


Wow! You can shrink the formula to half!! However, I don't have a
clue how to decipher it. Regarding the last (third) formula, this is the
first time I see an equal sign in a formula without "if" present.



I doubt that Epinn, it is just testing a condition. I think you will have
seen that many times in SUMPRODUCT

=SUMPRODUCT((rng1="A")*(rng2="B"))

so as before it is just getting a TRUE/FALSE result which is being coerced
by the * operator (again, just like you have seen in SUMPRODUCT). The
different thing here is I test against two value {1,7} and then using two
multipliers {2,1} which will get a value depending upon the day of the week
that the last day falls on.

I don't know if that little dash means minus and I don't understand the
array constants. But I don't want to take up your time explaining it to
me as I prefer you help me on something else that may need more of
my attention in the future. You know, I don't feel like "bugging" you all
day long. I'll just keep this formula in my bag for now.


I fear you are getting information overload now mate <g. That dash
certainly does mean minus, The formula just calculates the last date of the
month, then calculates if that last day is a Saturday or Sunday and
calculates the number of days to subtract if so, and subtracts them

=Get_end_of_month_date - adjustment

where

adjustment = If(day_of_end_of_month_date = Sat or Sun, return 1 or 2, else
return 0)