+ Reply to Thread
Results 1 to 4 of 4

Only show formula results if not 0 (zero)

  1. #1
    Forum Contributor
    Join Date
    07-24-2008
    Location
    San Antonio, Texas
    Posts
    118

    Only show formula results if not 0 (zero)

    I currently have a formula set to look at cell A2 and provide Friday's Date in cell B2 if Monday through Friday.

    For Example:

    Mon 10/27/2008 then formula result is 10/31/2008
    Tuesday 10/28/2008 then formula result is 10/31/2008....etc.

    Below is the formula I am using.

    =IF(WEEKDAY(D2,1)>=6,D2+((6-WEEKDAY(D2,1)))+6,D2+((6-WEEKDAY(D2,1))))

    I only want the formula result to display if the result is NOT equal to 0 (zero). So if there is no date in A2 then the B2 would be a blank cell with no formula results. Currently the result of the formula in B2 if A2 is blank is 1/5/1900 (Date Format)

    Any help would be greatly appreciated.
    Last edited by randolphoralph; 10-29-2008 at 12:16 PM.

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531
    I'm not really sure what you're formula is meant to be doing for Fri, Sat, Sun

    Does the below do what you want ?

    =IF(D2>0,D2+(5-WEEKDAY(D2,2))+(7*(WEEKDAY(D2,2)>=6)),"")

  3. #3
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    You're formula doesn't always return a Friday (e.g., for a Saturday in the referenced cell).

    Would you explain again what it's supposed to do?

    Edit: If you want the first Friday on or after today, then,

    =IF(D2, D2 + 7 - WEEKDAY(D2 - 4, 3), "")
    Last edited by shg; 10-29-2008 at 12:30 PM.
    Entia non sunt multiplicanda sine necessitate

  4. #4
    Forum Contributor
    Join Date
    07-24-2008
    Location
    San Antonio, Texas
    Posts
    118
    Thank you so much it works great! That is exactly what I was looking for.
    Last edited by randolphoralph; 10-29-2008 at 12:47 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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