Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

Logic Error on If formula

Discussion in 'Information Technology' started by Wendy, Jul 28, 2006.

  1. Wendy

    Wendy
    Expand Collapse
    Guest

    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
     
  2. Loading...

    Similar Threads Forum Date
    As A Child, Public Marches Of Sikhism Made Me Uncomfortable. They Still Do . Why ? Whats The Logic Hard Talk Oct 16, 2016
    India Akali Dal’s Goa conclave reinforces ideological shift Breaking News Mar 31, 2013
    Nature Borneo's Biological Treasure Trove Breaking News Dec 14, 2012
    USA US sikhs question the logic of SGPC announcing probe panel Breaking News Aug 8, 2012
    Controversial Logical Rudeness Hard Talk Sep 22, 2011

  3. Pieter Wijnen

    Pieter Wijnen
    Expand Collapse
    Guest

    Parenthises, Parenthises..

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


    "Wendy" <Wendy @sunnygirl.com> wrote in message
    news:UcudnXi3_KlDzD_ZnZ2dnUVZ8tydnZ2d@bt.com...
    > 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
    >
    >
     
  4. Pieter Wijnen

    Pieter Wijnen
    Expand Collapse
    Guest

    Parenthises, Parenthises..

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


    "Wendy" <Wendy @sunnygirl.com> wrote in message
    news:UcudnXi3_KlDzD_ZnZ2dnUVZ8tydnZ2d@bt.com...
    > 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
    >
    >




    --
    ----------------------------------------
    I am using the free version of SPAMfighter for private users.
    It has removed 4079 spam emails to date.
    Paying users do not have this message in their emails.
    Get the free SPAMfighter here: http://www.spamfighter.com/len
     
  5. Wendy

    Wendy
    Expand Collapse
    Guest

    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:esAz4KqmGHA.2112@TK2MSFTNGP04.phx.gbl...
    > Parenthises, Parenthises..
    >
    > IIf(Weekday(Date(),2)=1,Date()-3,Date()-1) ' 2 = to denote Monday as
    > firstdayofweek = vbMonday
    >
    >
    > "Wendy" <Wendy @sunnygirl.com> wrote in message
    > news:UcudnXi3_KlDzD_ZnZ2dnUVZ8tydnZ2d@bt.com...
    > > 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
    > >
    > >

    >
    >
    >
    > --
    > ----------------------------------------
    > I am using the free version of SPAMfighter for private users.
    > It has removed 4079 spam emails to date.
    > Paying users do not have this message in their emails.
    > Get the free SPAMfighter here: http://www.spamfighter.com/len
    >
    >
     

Share This Page