+ Reply to Thread
Results 1 to 3 of 3

Assign a specific value based on whether another value falls within varying ranges.

  1. #1
    Registered User
    Join Date
    10-29-2012
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    80

    Assign a specific value based on whether another value falls within varying ranges.

    I would like to assign a specific value to a cell based on another cell number.

    EG If D5 is greater than or equal to 5 then F5 = 5, If D5 is greater than 0 but less than 5 then F5 = 1, If D5 = 0 then F5 = 0, if D5 is less than 0 but more than minus 5 then F5 = -1, if D5 is greater than than or equal to -5 then F5 = -5

    I really don't know how to do this because I get my greater than and less than signs mixed up.

    Would really appreciate some hekp with this

    Graphic reperesentation:-


    -5 -4 -3 -2 -1 0 1 2 3 4 5
    -----------------------------------------------------------------------------------------
    (-5) ( -1 ) (0) ( +1 ) (5)

  2. #2
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,466

    Re: Assign a specific value based on whether another value falls within varying ranges.

    Try this:
    =IF(D5>=5,5,IF(D5>0,1,IF(D5=0,0,IF(D5>-5,-1,-5))))
    Quang PT

  3. #3
    Registered User
    Join Date
    10-29-2012
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    80

    Re: Assign a specific value based on whether another value falls within varying ranges.

    Quote Originally Posted by bebo021999 View Post
    Try this:
    =IF(D5>=5,5,IF(D5>0,1,IF(D5=0,0,IF(D5>-5,-1,-5))))
    Sir, you are an absolute star ! That works for me.
    I thank you for your rapid response. Your assistance is greatly appreciated.

+ 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