View Single Post
  #15   Report Post  
 
Posts: n/a
Default

Thanks all. May it possible to condition if the third friday occurs on
eithier March or June or September or December than give 1 else 0 ?

Thanks In Advance



JE McGimpsey wrote:
Neither Harlan nor I said anything about "easier to understand" (though
for most people, "--", while unfamiliar, is not particularly hard to
understand - see http://www.mcgimpsey.com/excel/doubleneg.html). Harlan
simply said that the extra function call to DAY() is inefficient, which
it is.

Nobody's saying your formula didn't work, nor that it was somehow wrong
(except that, as originally posted, it didn't meet the OP's 1/0
requirement). For new users, it's probably more readable.

Harlan's formula though, has the advantage of efficiency, and it's more
easily generalized (e.g., choosing the 2nd Friday can be accomplished by
a single change from 3 to 2, or the ordinal value could instead be
replaced by a cell reference). And for me, at least, it's more obvious
what the criterion is (i.e., the *3rd* friday, rather than having to
guess from the weekday numbers).

However, in most applications, either works fine. De gustibus non
disputandum est.



In article ,
"arno" wrote:

=--AND(WEEKDAY(A1)=6,INT(DAY(A1+6)/7)=3)


you are right, this (esp. the "--" part) is a lot easier to understand
and reproduce than

is the third friday not the only friday between 15th and 21st?
=IF(AND(DAY(a1)=15,day(a1)<=21,weekday(a1)=6),1, 0)


LOL