+ Reply to Thread
Results 1 to 6 of 6

A formula to stop another formula from operating in some instances

  1. #1
    Registered User
    Join Date
    08-24-2009
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    36

    A formula to stop another formula from operating in some instances

    I am wanting my newly developed time formula developed with the great help of excalforum, to only operate on particular days similar to the following:

    A1 = 21/08/2009
    A2 = '=A1' cell formatted to dddd only to show the day {Friday}

    I need another cell containing a formula to calculate on any day Monday to Friday, but not Saturday or sunday.

    I tried =if(A2="Saturday","",if(a2="Sunday","",IF(P6=1,"",((D6>E6)*MEDIAN(0,E6-'Front Sheet'!C18,'Front Sheet'!C19-'Front Sheet'!C18)+MAX(0,MIN('Front Sheet'!C19,E6+(D6>E6))-MAX('Front Sheet'!C18,D6)))*24)))

    But i dont think its recognising A2 as the word "Saturday" as its only a formatted version of A1.

    Ive tried a text() equation but i dont think thats right. how can i get this to work?
    Last edited by adhide; 08-25-2009 at 11:24 PM. Reason: Amend heading

  2. #2
    Forum Contributor
    Join Date
    04-21-2007
    Location
    Lima, Peru
    MS-Off Ver
    2000, 2007, 2010
    Posts
    674

    Re: A formula to stop another formula from operating in some instances

    Hi

    Why not something like

    Please Login or Register  to view this content.
    Regards

    Jeff

  3. #3
    Registered User
    Join Date
    08-24-2009
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    36

    Re: A formula to stop another formula from operating in some instances

    If i do this

    =IF(WEEKDAY(A1,2)<6,IF(P6=1,"",((D6>E6)*MEDIAN(0,E6-'Front Sheet'!C18,'Front Sheet'!C19-'Front Sheet'!C18)+MAX(0,MIN('Front Sheet'!C19,E6+(D6>E6))-MAX('Front Sheet'!C18,D6)))*24))

    I get the field returning 'False'

  4. #4
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: A formula to stop another formula from operating in some instances

    Perhaps:

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    08-24-2009
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    36

    Lightbulb Re: A formula to stop another formula from operating in some instances

    This looks great, and it works, but I would like to know how it does, as i need to do a similar thing in another field that only populate the formule if the day is a saturday, and in another cell,if it is a sunday.

  6. #6
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: A formula to stop another formula from operating in some instances

    For more info. I would suggest looking up WEEKDAY function in XL Help, it's quite detailed.

    Re: IF ...

    =IF(test,do if test true, do if test false)
    =IF(OR(test1,test2),do if either test1 or test2 are true, do if both are false)
    =IF(AND(test1,test),do if both test1 and test2 are true, do if either are false)

    Daddylonglegs has already gone through the complex bit - ie the date formula.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1