+ Reply to Thread
Results 1 to 4 of 4

Calculate the closest day

  1. #1
    Jim
    Guest

    Calculate the closest day

    Hello,

    I am creating a time card. I would like a formula that will calculate
    (show) Fridays date closest to the date when the spreadsheet is opened. For
    example If I opened the sheet today the formula would populate yesterdays
    date. If I opened the sheet on Tuesday, the sheet formula will populate next
    Fridays date, etc…

    Thanks


  2. #2
    CLR
    Guest

    Re: Calculate the closest day

    Assuming the date of the sheet opening is in A1.....

    =TEXT(A1+LOOKUP(WEEKDAY(A1),{1,2,3,4,5,6,7},{-2,-3,3,2,1,0,-1}),"mm/dd/yyyy
    dddd")

    Vaya con Dios,
    Chuck, CABGx3



    "Jim" <[email protected]> wrote in message
    news:[email protected]...
    > Hello,
    >
    > I am creating a time card. I would like a formula that will calculate
    > (show) Fridays date closest to the date when the spreadsheet is opened.

    For
    > example If I opened the sheet today the formula would populate yesterdays
    > date. If I opened the sheet on Tuesday, the sheet formula will populate

    next
    > Fridays date, etc.
    >
    > Thanks
    >




  3. #3
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675
    Try this formula

    =TODAY()+4-WEEKDAY(TODAY()-2)
    Last edited by daddylonglegs; 01-14-2006 at 09:33 PM.

  4. #4
    Jim
    Guest

    Re: Calculate the closest day

    perfect

    "CLR" wrote:

    > Assuming the date of the sheet opening is in A1.....
    >
    > =TEXT(A1+LOOKUP(WEEKDAY(A1),{1,2,3,4,5,6,7},{-2,-3,3,2,1,0,-1}),"mm/dd/yyyy
    > dddd")
    >
    > Vaya con Dios,
    > Chuck, CABGx3
    >
    >
    >
    > "Jim" <[email protected]> wrote in message
    > news:[email protected]...
    > > Hello,
    > >
    > > I am creating a time card. I would like a formula that will calculate
    > > (show) Fridays date closest to the date when the spreadsheet is opened.

    > For
    > > example If I opened the sheet today the formula would populate yesterdays
    > > date. If I opened the sheet on Tuesday, the sheet formula will populate

    > next
    > > Fridays date, etc.
    > >
    > > Thanks
    > >

    >
    >
    >


+ 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