+ Reply to Thread
Results 1 to 2 of 2

IF function not returning values correctly (what did I miss)

  1. #1
    Registered User
    Join Date
    01-13-2010
    Location
    Oxford
    MS-Off Ver
    Excel 2010
    Posts
    57

    IF function not returning values correctly (what did I miss)

    Hi Everyone

    For some reason I can't figure out why this formula is still returning the wrong value

    =IF(N2<18,"0-17",IF(AND(N2>=18,N2<=34),"18-34",IF(AND(N2>=35,N2<=50),"35-50",IF(N2>50,"50+",IF(N2="NULL", "No Age Given", "-"))))

    I tried moving the final false criteria to the out parenthesis but I still get the wrong results i.e. if column N2 = NULL O2 = 50+

    I'm sure it's a quick one but I've been looking at measures and formula for a while now and I've gone brain neutral

    Thanks for your help

    Daniel

  2. #2
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: IF function not returning values correctly (what did I miss)

    Test for NULL first of all, then check the number ranges.

    Alternatively replace the formula with this

    =IF(N2="NULL","No Age Given",LOOKUP(N2,{0,18,35,51},{"0-17","18-34","35-50","51+"}))
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

+ 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. Returning Four Different Values For an IF Function
    By WSJ in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-24-2014, 05:16 PM
  2. [SOLVED] How to use the if function to display multiple values correctly
    By rbi123 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-28-2013, 10:02 AM
  3. If function returning values from other cells
    By Angeltown in forum Excel General
    Replies: 6
    Last Post: 05-26-2011, 04:37 PM
  4. Find Function - Returning Values
    By controlfreak in forum Excel General
    Replies: 1
    Last Post: 06-03-2009, 07:38 AM
  5. Function not returning correctly please look
    By AA76 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 10-27-2006, 04:45 PM
  6. [SOLVED] Function to find difference between two similar worksheets is miss
    By Jawahar in forum Excel General
    Replies: 2
    Last Post: 07-31-2006, 09:38 AM
  7. Returning only positive values from a function
    By Ceves in forum Excel General
    Replies: 1
    Last Post: 04-02-2006, 10:57 PM
  8. Large Function returning top values
    By J Shrimps, Jr. in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 03-30-2006, 11:10 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