Logic Error on If formula

  • Thread starter Thread starter Wendy
  • Start date Start date
W

Wendy

Hi

I have a formula which should produce yesterdays data if today is
tues,wed,thur or fri, if today is monday it should produce fridays data, and
sometimes there isn't any data at all.

IIf(Weekday(Date()=1),Date()-3,Date()-1)
this method works if today is monday.

IIf(Weekday(Date()=1),Date()-1,Date()-3)
this method works if its tues, wed, thur or fri

Is it possible to get it working for everyday?

Thanks

Wendy
 
Parenthises, Parenthises..

IIf(Weekday(Date(),2)=1,Date()-3,Date()-1) ' 2 = to denote Monday as
firstdayofweek = vbMonday
 
Parenthises, Parenthises..

IIf(Weekday(Date(),2)=1,Date()-3,Date()-1) ' 2 = to denote Monday as
firstdayofweek = vbMonday


Wendy said:
Hi

I have a formula which should produce yesterdays data if today is
tues,wed,thur or fri, if today is monday it should produce fridays data,
and
sometimes there isn't any data at all.

IIf(Weekday(Date()=1),Date()-3,Date()-1)
this method works if today is monday.

IIf(Weekday(Date()=1),Date()-1,Date()-3)
this method works if its tues, wed, thur or fri

Is it possible to get it working for everyday?

Thanks

Wendy



--
 
Thanks, I often get muddled up on how many I actually need!

Wendy

"Pieter Wijnen"
<it.isi.llegal.to.send.unsollicited.mail.wijnen.nospam.please@online.replace
..with.norway> wrote in message news:[email protected]...
 
Back
Top