+ Reply to Thread
Results 1 to 6 of 6

Nested If and TODAY() in One Formula

  1. #1
    Registered User
    Join Date
    04-24-2014
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    5

    Nested If and TODAY() in One Formula

    Hello. I have to make a formula with a nested if function using either a date given in the cell or today's date if a cell is blank.

    =IF(B5<>"",IF(B5-A5<=14,"Fast",IF(B5<>"",IF(B5-A5<=45,"Regular",IF(B5<>"",IF(B5-A5<=90,"Slow",IF(B5<>"",IF(B5-A5>91,"Problem"),IF(TODAY()-A5<=15,"Fast",IF(TODAY()-A5<=45,"Average",IF(TODAY()-A5<=90,"Slow",IF(TODAY()-A5>91,"Problem")))))))))))

    In cell b is either a blank cell or the given date. In cell A is the date it was made.
    I cannot figure out the problem in the formula, however, as it is coming up false for the days which cell B was blank when it should be using today's date.
    Any help would be appreciated. Thank you.
    Last edited by iLLthunder15; 04-25-2014 at 07:56 PM.

  2. #2
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,136

    Re: Nested If and TODAY() in One Formula

    welcome to the forum. since your formula doesn't work, you ought to tell us how the logic goes. what should be the answers in column c? and i noticed if B5 is not equals to blank, then <=14 is fast? but if it's blank, <=15 is fast? if it's really two different values, maybe:
    =IF(B5="",LOOKUP(TODAY()-A5,{0,15,46,91},{"Fast","Regular","Slow","Problem"}),LOOKUP(B5-A5,{0,14,46,91},{"Fast","Regular","Slow","Problem"}))

    if both are supposed to be <=15, then
    =LOOKUP(IF(B5="",TODAY(),B5)-A5,{0,15,46,91},{"Fast","Regular","Slow","Problem"})

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  3. #3
    Forum Expert cbatrody's Avatar
    Join Date
    04-15-2014
    Location
    Dubai
    MS-Off Ver
    Microsoft Office 365 ProPlus
    Posts
    2,135

    Re: Nested If and TODAY() in One Formula

    Hi,

    I have modified your initial formula as following, please check if it works:

    =IF(B5<>"",IF(B5-A5<=14,"Fast",IF(B5-A5<=45,"Regular",IF(B5-A5<=90,"Slow",IF(B5-A5>91,"Problem")))),(IF(TODAY()-A5<=15,"Fast",IF(TODAY()-A5<=45,"Average",IF(TODAY()-A5<=90,"Slow",IF(TODAY()-A5>91,"Problem"))))))

  4. #4
    Registered User
    Join Date
    04-24-2014
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Nested If and TODAY() in One Formula

    Thank you for the greeting and your response.
    It should have been <=15, not less than <=14 so what was a typo by me.
    In cell C, if the date after the subtraction is 15 or less days, it should be "fast", 16-45 for "regular" and so on.
    Your Formula works for the correct result so thank you.
    However, is your formula using "nested if"? And if not, is there a way to get the same results using nested if along with using the today function?
    Thank you.

  5. #5
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 for Mac OSX & Windows
    Posts
    6,811

    Re: Nested If and TODAY() in One Formula

    does this work ?
    =IF(B5<>"", IF(B5-A5<=14,"Fast", IF(B5-A5<=45,"Regular", IF(B5-A5<=90,"Slow", IF(B5-A5>91,"Problem", "not in range" )))),IF(TODAY()-A5<=15,"Fast", IF(TODAY()-A5<=45,"Average",IF(TODAY()-A5<=90,"Slow",IF(TODAY()-A5>91,"Problem", "not in range")))))
    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.

  6. #6
    Registered User
    Join Date
    04-24-2014
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Nested If and TODAY() in One Formula

    This formula works perfectly and is "nested if". Thank you cbatrody! Also, thank you etaf for your response and once again you Beni for your initial response.

+ 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: 8
    Last Post: 09-26-2014, 03:51 PM
  2. [SOLVED] Nested if date less then equal today or blank
    By adamcfishman in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 05-07-2013, 01:43 PM
  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. help on a nested countif/nested if formula
    By vickiemc in forum Excel General
    Replies: 2
    Last Post: 08-13-2008, 08:29 AM
  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