+ Reply to Thread
Results 1 to 6 of 6

using today() with if

  1. #1
    Registered User
    Join Date
    11-15-2012
    Location
    NY, USA
    MS-Off Ver
    Excel 2010
    Posts
    44

    using today() with if

    Hi, I have 2 adjacent cells C5=Today()-1 and D5=Today(). And there are 100's of numbers under them and getting compared based on look up by date. Everything works fine till I hit Monday and that's where I need C5 to display Friday and not Sunday. Thought =IF(Today()=Monday,Today()-3,Today()-1 would work but I was wrong.

    Any solutions? I am trying not to use VB.

    Thanks
    N

  2. #2
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.92 (24120731))
    Posts
    9,152

    Re: using today() with if

    you need weekday()

    so
    Weekday(today(),2)
    which will give back a number starting with Monday as a 1

    so
    If( Weekday(today(),2) = 7, Today()-3,Today()-1 )
    Wayne
    if my assistance has helped, and only if you wish to , there is an "* Add Reputation" on the left hand side - you can add to my reputation here

    If you have a solution to your thread - Please mark your thread solved do the following: >
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  3. #3
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: using today() with if

    You could use
    =WORKDAY(F3,-1)
    or if you want to use the IF statement,
    IF(Weekday(D5)=2, TODAY()-3, TODAY()-1)
    Either of these work for you?
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  4. #4
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: using today() with if

    Try

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  5. #5
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: using today() with if

    =workday(today(),-1)

  6. #6
    Registered User
    Join Date
    11-15-2012
    Location
    NY, USA
    MS-Off Ver
    Excel 2010
    Posts
    44

    Re: using today() with if

    Thank you all, all solutions worked!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 10
    Last Post: 09-06-2023, 08:19 PM
  2. [SOLVED] Counting Tasks With Due Dates between TODAY and TODAY+7
    By Erik_with_a_K in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 04-29-2013, 09:00 AM
  3. Replace today() with a hardcoded value representing today in all tabs
    By Romanian37 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-23-2013, 07:03 AM
  4. AutoFilter for any cell between =today() and =today()+14??
    By kpratico in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-01-2010, 04:36 PM
  5. Replies: 3
    Last Post: 12-11-2007, 01:36 PM

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