+ Reply to Thread
Results 1 to 6 of 6

Formula for if a value is above, below or within a range

  1. #1
    Registered User
    Join Date
    05-30-2015
    Location
    Bath, England
    MS-Off Ver
    2013
    Posts
    4

    Red face Formula for if a value is above, below or within a range

    Hi, I am analysing a large data set. I basically need to know if a value is below X, above Y or between X and Y. And depending on which of these is the case, a different value will appear. I have three columns as shown below. Columns 2 and 3 represent a range (Value x to value y)

    Column 1 Column 2 Column 3 Column 4
    Row 1 3 4 7 -1
    Row 2 5 3 6 0
    Row 3 6 2 5 1

    I want the formula to give a value of -1 if the value in column 1 is lower than the value in column 2 (As is Row 1)
    I want the formula to give a value of 0 if the value in column 1 is equal to or between the values in column 2 and column 3 (As in Row 2)
    I want the formula to give a value of +1 if the value in column 1 is greater than the value in column 3 (As in row 3)

    Basically if the value in below the range -1, within the range (including the values of the range) 0, and above the range 1

    If anyone can help with this i would REALLY REALLY appreciate it as I am at a wall now and cant make sense of it!

    Thanks

  2. #2
    Forum Expert Tsjallie's Avatar
    Join Date
    09-15-2012
    Location
    NL
    MS-Off Ver
    2010, 2013, 2016
    Posts
    2,077

    Re: Formula for if a value is above, below or within a range

    This should just do that:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Cheers!
    Tsjallie




    --------
    If your problem is solved, pls mark the thread SOLVED (see Thread Tools in the menu above). Thank you!

    If you think design is an expensive waste of time, try doing without ...

  3. #3
    Registered User
    Join Date
    05-30-2015
    Location
    Bath, England
    MS-Off Ver
    2013
    Posts
    4

    Re: Formula for if a value is above, below or within a range

    Thank you Tsjallie! I will try that right now!

  4. #4
    Registered User
    Join Date
    05-30-2015
    Location
    Bath, England
    MS-Off Ver
    2013
    Posts
    4

    Re: Formula for if a value is above, below or within a range

    It Worked!! Thank you so so much

  5. #5
    Forum Expert
    Join Date
    12-11-2011
    Location
    Netherlands
    MS-Off Ver
    office 365
    Posts
    3,632

    Re: Formula for if a value is above, below or within a range

    Please Login or Register  to view this content.
    Or maybe just this.
    Willem
    English is not my native language sorry for errors
    Please correct me if I'm completely wrong

  6. #6
    Registered User
    Join Date
    04-22-2024
    Location
    Austin, TX
    MS-Off Ver
    Most current
    Posts
    1

    Re: Formula for if a value is above, below or within a range

    Quote Originally Posted by Tsjallie View Post
    This should just do that:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    This worked for me, thank you so much!

+ 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. Replies: 1
    Last Post: 03-02-2015, 11:18 AM
  2. Replies: 1
    Last Post: 11-07-2014, 01:42 PM
  3. Replies: 2
    Last Post: 09-01-2014, 07:59 AM
  4. [SOLVED] chart based on dynamic range which resizes as per data in range-formula / vba
    By KK1234 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-11-2014, 04:02 PM
  5. Replies: 1
    Last Post: 09-04-2013, 07:23 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