+ Reply to Thread
Results 1 to 9 of 9

Nested if statement with three variables

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    01-18-2010
    Location
    Los Angeles, CA
    MS-Off Ver
    Excel 2010
    Posts
    128

    Nested if statement with three variables

    Hi Gurus,
    I have a date in V5 and an positive or negative amount in AD5.
    This is what I would like to achieve:
    If V5 is larger than today's date and AD5 has any amount other than zero in it, put "Current", else put "Review. Within the same expression I would also like to say that if V5 is older than today's date and AD5 is exactly zero, then put the word "Closed".

    Thank you very much

  2. #2
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: Nested if statement with three variables

    Try

    =IF(V5>TODAY(),IF(AD5>0,"Current",IF(AD5=0,"Closed","Review")),"")
    Last edited by Ace_XL; 08-27-2013 at 02:11 PM.
    Life's a spreadsheet, Excel!
    Say thanks, Click *

  3. #3
    Forum Contributor
    Join Date
    01-18-2010
    Location
    Los Angeles, CA
    MS-Off Ver
    Excel 2010
    Posts
    128

    Re: Nested if statement with three variables

    Hi Ace,
    Actually, AD5 can be either a negative or positive number, other than zero. Also, if the date is older than today and there is anegative or positive number in AD5, it has to say "Review. The "Closed" condition is only if the date is older than today AND the amount is exactly zero.
    Thanks!


    Quote Originally Posted by Ace_XL View Post
    Try

    =IF(V5>TODAY(),IF(AD5>0,"Current",IF(AD5=0,"Closed","")),"")

  4. #4
    Forum Contributor
    Join Date
    01-18-2010
    Location
    Los Angeles, CA
    MS-Off Ver
    Excel 2010
    Posts
    128

    Re: Nested if statement with three variables

    Hi Ace,
    Not quite there.
    Here is a snippet of examples I would like to achieve:
    Activity: End Date: Amount:
    Current 6/30/2014 (100,000.00)
    Current 6/30/2014 240,674.75
    Closed 6/30/2009 -
    Review 6/30/2009 (139,991.75)
    Review 6/30/2009 14,250.00
    Last edited by kisboros; 08-27-2013 at 02:24 PM. Reason: More info

  5. #5
    Forum Contributor
    Join Date
    05-07-2013
    Location
    apple valley ca
    MS-Off Ver
    Excel 2007
    Posts
    110

    Re: Nested if statement with three variables

    sounds like you need a "AND" statements nested with "IF" statement.. try this..in cell A1 =IF(AND(V5>=TODAY(),AD5<>0),"CURRENT",IF(AND(V5<=TODAY(),AD5=0),"CLOSED","REVIEW"))
    hope it works
    S

    Quote Originally Posted by kisboros View Post
    Hi Gurus,
    I have a date in V5 and an positive or negative amount in AD5.
    This is what I would like to achieve:
    If V5 is larger than today's date and AD5 has any amount other than zero in it, put "Current", else put "Review. Within the same expression I would also like to say that if V5 is older than today's date and AD5 is exactly zero, then put the word "Closed".

    Thank you very much

  6. #6
    Forum Contributor
    Join Date
    01-18-2010
    Location
    Los Angeles, CA
    MS-Off Ver
    Excel 2010
    Posts
    128

    Re: Nested if statement with three variables

    Works like a champ! Thank you very much!

  7. #7
    Forum Contributor
    Join Date
    01-18-2010
    Location
    Los Angeles, CA
    MS-Off Ver
    Excel 2010
    Posts
    128

    Re: Nested if statement with three variables

    I sent the thanks to you, but didn't include the quote.
    Quote Originally Posted by xwarlock10x View Post
    sounds like you need a "AND" statements nested with "IF" statement.. try this..in cell A1 =IF(AND(V5>=TODAY(),AD5<>0),"CURRENT",IF(AND(V5<=TODAY(),AD5=0),"CLOSED","REVIEW"))
    hope it works
    S

  8. #8
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,954

    Re: Nested if statement with three variables

    If V5 is larger than today's date and AD5 has any amount other than zero in it, put "Current", else put "Review. Within the same expression I would also like to say that if V5 is older than today's date and AD5 is exactly zero, then put the word "Closed".
    =if(V5>today(),if(AD5<>0,"Current","Review"),if(AD5=0,"Closed",""))

    (You dont specify what to do if it is exactly today's date, so I used "" at the end)
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  9. #9
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,954

    Re: Nested if statement with three variables

    Happy to help and thanks for the feedback

+ 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. Nested VLOOKUP & SUMIF in IF STATEMENT with several variables
    By sarahw in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-30-2013, 02:47 PM
  2. Nested For Each loop for 2 range variables
    By artur.serra in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-03-2013, 10:34 AM
  3. [SOLVED] Nested If Statement - ISBLANK and ISNA in same statement?
    By Janc in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 04-23-2013, 09:00 AM
  4. Nested IF Formula Using Variables
    By Gard5096 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-08-2013, 02:36 PM
  5. Replies: 6
    Last Post: 01-14-2009, 06:59 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