+ Reply to Thread
Results 1 to 4 of 4

How to Return a Value If In a Specified Set of Numbers

  1. #1
    Registered User
    Join Date
    10-03-2014
    Location
    Denver, CO
    MS-Off Ver
    2013
    Posts
    17

    Question How to Return a Value If In a Specified Set of Numbers

    Hello Gurus,

    I'm stuck trying to figure out the proper syntax for returning a value for a set of numbers.

    e.g. - If cell C7 = 8" - 24", then .5, if not, 0; If C7 = 25" - 40", then .75; if not, 0; If C7 = 41" - 60", then 1, if not, 0

    The inches are ranges the cell value must fall in to return the specified value.

    Any help would be greatly appreciated.

    Thank you in advance.

  2. #2
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: How to Return a Value If In a Specified Set of Numbers

    use VLookup for that kind of work.

    edit.

    8" - 24" 0,5 0 0,00
    8" - 24" 0,50
    25" - 40" 0,75
    41" - 60" 1,00

    =Vlookup(A9,$C$9:$D$12,2,0)
    Last edited by oeldere; 08-02-2016 at 02:16 PM.
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  3. #3
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,430

    Re: How to Return a Value If In a Specified Set of Numbers

    Assuming whole inches ..

    =IF(C7>60,0,IF(C7>40,1,IF(C7>24,0.75,IF(C7>=7,0.5,0))))

    Not sure if test > 60 is required: it is redundant if 60 is never exceeded.

  4. #4
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: How to Return a Value If In a Specified Set of Numbers

    How will you be entering the value in C7?

    Will it be just a number like 10? Will it only be whole numbers or can it be a decimal like 10.5?

    Or, will it be the number and the quotes like this 10"? Or, will it be the whole string like this 8" - 24" ?
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

+ 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. Return a 1st, 2nd, or 3rd from row of numbers.
    By johnogolf in forum Excel General
    Replies: 19
    Last Post: 04-30-2013, 10:09 AM
  2. [SOLVED] If value is between a range of numbers, return value X
    By Oberst Hajj in forum Excel General
    Replies: 9
    Last Post: 07-15-2012, 06:17 AM
  3. [SOLVED] Vlookup formula - return only numbers for cells containing text and numbers
    By Andrew E Smith in forum Excel General
    Replies: 11
    Last Post: 07-03-2012, 06:07 AM
  4. sum to only return +ve numbers
    By Peter1973 in forum Excel General
    Replies: 3
    Last Post: 06-12-2012, 07:22 PM
  5. Return zero for negative numbers.
    By pdmkh in forum Excel General
    Replies: 1
    Last Post: 01-20-2011, 07:53 AM
  6. print only formulated cells that return numbers rather than cells that return blank
    By jaganath in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-24-2010, 03:46 PM
  7. Return an array of numbers
    By Royker in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 10-16-2007, 06:23 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