+ Reply to Thread
Results 1 to 4 of 4

If then statement with Great than and less than

  1. #1
    Forum Contributor
    Join Date
    01-28-2013
    Location
    Spencerport, NY
    MS-Off Ver
    Excel 2016
    Posts
    270

    If then statement with Great than and less than

    Hello All
    I thought I had the right formula, but here is what I am looking for

    Column H contains age of patient. If age is less than 18 I want to return "0 to 18". Age greater than 18 but less than 65 return a "19 to 64" and age greater than 64 returns a ;'65 and Older"
    Below is the formula, but cant quite figure out what is wrong. Any help is appreciated


    =IF(H2<=18,"0 to 18",IF(AND(h2>18,h2<65),"19 to 64"),IF(H2>64,"65andOlder"))))
    Attached Files Attached Files

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

    Re: If then statement with Great than and less than

    As you have tested for age less than or equal to 18 in your first IF, you don't need to test for it again in your second IF. The formula can be simplified to:

    =IF(H2<=18,"0 to 18",IF(H2<65,"19 to 64","65andOlder"))

    Copy down as required.

    Hope this helps.

    Pete

  3. #3
    Forum Contributor
    Join Date
    01-28-2013
    Location
    Spencerport, NY
    MS-Off Ver
    Excel 2016
    Posts
    270

    Re: If then statement with Great than and less than

    Perfect ! Thank you Pete

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

    Re: If then statement with Great than and less than

    You're welcome - thanks for the rep.

    Pete

+ 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. Great to be here!
    By Xafloc in forum Hello..Introduce yourself
    Replies: 1
    Last Post: 12-20-2019, 12:54 AM
  2. I cannot figure out the greater than formula
    By greenenergygooru in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-28-2014, 12:09 PM
  3. It's really great to be here....
    By CaptBret in forum Hello..Introduce yourself
    Replies: 1
    Last Post: 08-14-2013, 07:24 PM
  4. Add an if statement on the end of a sum. Any help would be great thanks :)
    By jameskinguk in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-27-2013, 06:50 PM
  5. Great to be here!
    By rsagar-patt in forum Hello..Introduce yourself
    Replies: 1
    Last Post: 11-25-2012, 05:56 AM
  6. [SOLVED] Problem with nested IF_OR statement:great formula
    By RagDyeR in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-06-2005, 10:05 AM
  7. Less than great
    By jackcarver in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-11-2005, 03: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