+ Reply to Thread
Results 1 to 5 of 5

Nested If/Then Statement

  1. #1
    Registered User
    Join Date
    12-05-2012
    Location
    Phoenix, AZ
    MS-Off Ver
    Excel 2007
    Posts
    2

    Exclamation Nested If/Then Statement

    If:

    cell a1 = 10
    cell a2 = 15
    cell a3 = 20

    I am trying to write the following where the value in cell a4 = 5:

    if a4 is <=a1 and >=a3, 5, if < a1 10, and if >a3 0

    Can someone help me write this statement?

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Nested If/Then Statement

    So try this:

    =IF(AND(A4<=A1, A4>=A3), 5, IF(A4<A1, 10, IF(A4>A3, 0, "none")))
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,730

    Re: Nested If/Then Statement

    Try this:

    =IF(AND(A4<=A1,A4>=A3),5,IF(A4<A1,10,IF(A4>A3,0,"not specified")))

    You can see that there are some conditions that your description did not cover - you can change the "not specified" message to some other value.

    Hope this helps.

    Pete

  4. #4
    Registered User
    Join Date
    12-05-2012
    Location
    Phoenix, AZ
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Nested If/Then Statement

    Thank you!!!!!!!!!!!!!

  5. #5
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Nested If/Then Statement

    If that takes care of your original query, please select Thread Tools from the menu above and mark the thread as solved. 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