+ Reply to Thread
Results 1 to 7 of 7

IF formula that allocate values if a coloumns values fall within a certain numeric value

  1. #1
    Registered User
    Join Date
    12-05-2017
    Location
    Glasgow,Scotland
    MS-Off Ver
    2014
    Posts
    15

    IF formula that allocate values if a coloumns values fall within a certain numeric value

    Hi All,

    Im trying to build a nested IF formula that can run through my columns values and allocate the right number grade.

    So far it looks like this however its not returning the correct values

    =IF(T5<0,"-1",IF(T5<-4,"-2",IF(T5<-8,"-3",IF(T5<=-12,"-4",IF(T5<-12,"-5",IF(T5=0,"1",IF(T5<=4,"2",IF(T5<=8,"3",IF(T5<=12,"4",IF(T5>12,"5"))))))))))

    Any help would be greatly appreciated,

    Thanks in advance !

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

    Re: IF formula that allocate values if a coloumns values fall within a certain numeric v

    You have to get the order right
    and your IFs dont make sense

    IF(T5 <=-12 then -4
    IF(T5 < -12 then -5

    So which is it IF T5 <=-12 -4 or -5 ? It cant be both
    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.

  3. #3
    Valued Forum Contributor
    Join Date
    11-28-2015
    Location
    indo
    MS-Off Ver
    2016 64 bitt
    Posts
    1,268

    Re: IF formula that allocate values if a coloumns values fall within a certain numeric v

    If(t5>12,5,Lookup(T5,{-5,-4,-8,-12,0,4,8,12,12},{-1,-2,-3,-4,-5,1,2,3,4}))
    "ThankyouFor Attention * And Your Help!!"

  4. #4
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.83 (24031120))
    Posts
    8,739

    Re: IF formula that allocate values if a coloumns values fall within a certain numeric v

    the IF runs in order
    so T5 < 0 would also pickup -4 , and any of the - numbers so you would only get 0 -1 for any - (minus) number

    you then have a
    T5<=-12,"-4",IF(T5<-12

    so the second T5<-12 will never be true

    you can still use an IF but look at the order

    = you want
    -5 if T5 is less than -12
    -4 If T5 = -12
    -3 if less than -8
    -2 if less than -4
    -1 if less than 0

    so do them in that ORDER

    =IF(T5<-12,-5,IF(T5=-12,-4,IF(T5<-8,-3,IF(T5<-4,-2,IF(T5<0,-1,IF(T5>12,5,IF(T5=0,1,IF(T5<4,2,IF(T5<8,3,IF(T5<=12,4,"Not Meet Criteria"))))))))))

    Putting numbers in "" also makes them text and not a number

    what happens
    a lookup would probably work better
    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.

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

    Re: IF formula that allocate values if a coloumns values fall within a certain numeric v

    and remove the spaces, I dont think you need them.
    Looks like it should actually be this:

    =IF(T5<-12,-5,IF(T5=-12,4,IF(T5<-8,-3,IF(T5<-4,-2,IF(T5<0,-1,IF(T5=0,1,IF(T5>12,5,IF(T5>8,4,IF(T5>4=3,2)))))))))

  6. #6
    Registered User
    Join Date
    12-05-2017
    Location
    Glasgow,Scotland
    MS-Off Ver
    2014
    Posts
    15

    Re: IF formula that allocate values if a coloumns values fall within a certain numeric v

    Thanks for the prompt replies everyone. Special-K you seemed to have nailed it in regards to what I was looking for. Thanks for being so informative and keeping my formula etiquette in check :P

    Really guys thanks so much for taking your time to respond to my issue, means alot


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

    Re: IF formula that allocate values if a coloumns values fall within a certain numeric v

    Credit should go to the others who replied as I corrected a mistake in my original reply based on their answers!

+ 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. Applying Formula to assign numeric values to text values in sequential order
    By jmshanahan in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-15-2016, 03:04 PM
  2. [SOLVED] Formula to add values that fall in a Month
    By bouncingbudha in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-02-2015, 11:33 PM
  3. [SOLVED] vba macros to force user to input numeric values for numeric values with hyphen
    By Abdur_rahman in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 09-28-2013, 01:05 PM
  4. [SOLVED] UDF to Vlookup multiple delimited values (numeric/non-numeric) and sum found values
    By Geert Rottiers in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-21-2013, 09:30 AM
  5. [SOLVED] Allocate months across periods in which they fall?
    By maladrat in forum Excel General
    Replies: 9
    Last Post: 07-26-2012, 01:21 PM
  6. Allocate days into periods in which they fall
    By BRISBANEBOB in forum Excel General
    Replies: 2
    Last Post: 07-05-2009, 07:31 PM
  7. Replies: 4
    Last Post: 04-05-2008, 10:43 AM

Tags for this Thread

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