+ Reply to Thread
Results 1 to 6 of 6

How do you get a specific value for a numbers between two values (0-99 = 0)

  1. #1
    Registered User
    Join Date
    07-11-2017
    Location
    Alberta Canada
    MS-Off Ver
    2016
    Posts
    5

    How do you get a specific value for a numbers between two values (0-99 = 0)

    I cannot seem to figure out how to get excel to perform this task.

    If an set value falls between 0 to 99 it must = 0 in the adjacent cell, example 88 = 0 and so forth.

    0 to 99 0
    100 to 199 -1
    200 to 299 -1
    300 to 399 -1
    400 to 499 -1
    500 to 599 -2
    600 to 699 -2
    700 to 799 -2
    800 to 899 -3
    900 to 999 -3

    Any suggestions. Thanks.

  2. #2
    Forum Expert leelnich's Avatar
    Join Date
    03-20-2017
    Location
    Delaware, USA
    MS-Off Ver
    Office 2016
    Posts
    2,807

    Re: How do you get a specific value for a numbers between two values (0-99 = 0)

    See Post #4
    Here's 1 way (each piece yields 1 if TRUE, 0 if FALSE):
    =(A2>99)+(A2>499)+(A2>799)

    Here's another (MATCH finds the position of the largest element <=A2 in a list; INDEX returns a corresponding element from a 2nd list):
    =INDEX({0,1,2,3},MATCH(A2,{0,100,500,700}))

    Or just:
    =MATCH(A4,{0,100,500,700})-1

    Please click the Add Reputation star below any helpful posts, and if you have your answer, mark your thread as SOLVED (Thread Tools up top). Thanks!-Lee
    Last edited by leelnich; 07-11-2017 at 10:55 PM.

  3. #3
    Registered User
    Join Date
    07-11-2017
    Location
    Alberta Canada
    MS-Off Ver
    2016
    Posts
    5

    Re: How do you get a specific value for a numbers between two values (0-99 = 0)

    That will give me a False or True correct?

    I am trying to get a number associated to the range between to values.
    For example.
    0-99 = 0 in adjacent cell. So if I was to enter 88 in A1, A2 would give a number of 0
    100 - 499 must = -1 in the adjacent cell. So if I was to enter 255 in A1 it would give a -1 in A2

    thanks.

  4. #4
    Forum Expert leelnich's Avatar
    Join Date
    03-20-2017
    Location
    Delaware, USA
    MS-Off Ver
    Office 2016
    Posts
    2,807

    Re: How do you get a specific value for a numbers between two values (0-99 = 0)

    Sorry, thought it was [1,2,3], not [-1,-2,-3]

    Here's 1 way (each piece yields 1 if TRUE, 0 if FALSE):
    =-(A2>99)-(A2>499)-(A2>799)

    Here's another (MATCH finds the position of the largest element <=A2 in a sorted list; INDEX returns the corresponding element from a 2nd list):
    =INDEX({0,-1,-2,-3},MATCH(A2,{0,100,500,700}))

    Or just:
    =1-MATCH(A4,{0,100,500,700})
    Last edited by leelnich; 07-12-2017 at 01:57 AM.

  5. #5
    Registered User
    Join Date
    07-11-2017
    Location
    Alberta Canada
    MS-Off Ver
    2016
    Posts
    5

    Re: How do you get a specific value for a numbers between two values (0-99 = 0)

    Sweet. That works thanks.

  6. #6
    Forum Expert leelnich's Avatar
    Join Date
    03-20-2017
    Location
    Delaware, USA
    MS-Off Ver
    Office 2016
    Posts
    2,807

    Re: How do you get a specific value for a numbers between two values (0-99 = 0)

    You're welcome, happy to help! If complete, please go to Thread Tools up top and mark your thread as SOLVED. Thanks!-Lee

    Please click the Add Reputation star below any helpful posts, and if you have your answer, mark your thread as SOLVED (Thread Tools up top). Thanks!-Lee

+ 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. [SOLVED] Function possible for Using specific number to count other specific numbers total ?
    By Karnik in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 05-02-2015, 03:35 AM
  2. [SOLVED] How to delete a row with specific values in a that fall between certain numbers
    By John Swift in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-05-2014, 08:27 AM
  3. Replies: 5
    Last Post: 02-22-2014, 03:45 AM
  4. Replies: 2
    Last Post: 11-21-2012, 05:59 AM
  5. Replies: 6
    Last Post: 10-21-2010, 05:38 PM
  6. Replies: 15
    Last Post: 10-11-2009, 11:46 AM
  7. Summing Numbers With Specific Values To The Left Of Them
    By FuzionZero in forum Excel General
    Replies: 8
    Last Post: 02-16-2007, 04: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