+ Reply to Thread
Results 1 to 3 of 3

assigning cell value based on a number range

  1. #1
    Registered User
    Join Date
    04-25-2012
    Location
    US
    MS-Off Ver
    Excel 2007
    Posts
    5

    assigning cell value based on a number range

    I was able to get this statement to work as expected

    =IF(AND(A2>=1,A2<=99),$A$1,IF(AND(A2>=100,A2<=900),$A$53))

    the problem is I have about 15 or 20 ranges I would like to use
    1-99, 100-900, 901-1105, etc. ranges are variable.

    I know I can only nest 7 If statements together. Even I could figure out how to do that there has to be a better way :-)

    My VBA skills are barely above nil.

    Not sure if I'm in the right portion of the forum. Let me know I can repost if necessary.

  2. #2
    Forum Expert ConneXionLost's Avatar
    Join Date
    03-11-2009
    Location
    Victoria, Canada
    MS-Off Ver
    2010
    Posts
    2,952

    Re: assigning cell value based on a number range

    Consider using the LOOKUP function, or building a lookup table that lists your desired values.

    If you would like a more specific example, try attaching a sample spreadsheet.

    Cheers,
    Would you like to say thanks? Please click the: " Add Reputation" button, on the grey bar below the post.

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: assigning cell value based on a number range

    Sounds to me like you could use a vlookup for this?

    Create a table with 1 column containing the minimum of a range, and the next contains the value you want
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

+ 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. Assigning value based upon number within a range. excel 2003
    By elewis1220 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 08-05-2013, 05:05 PM
  2. Replies: 1
    Last Post: 07-18-2013, 10:11 AM
  3. Assigning specific value to a number range.
    By xceldummie in forum Excel General
    Replies: 3
    Last Post: 04-23-2012, 11:32 AM
  4. Replies: 5
    Last Post: 04-06-2010, 04:23 PM
  5. Replies: 2
    Last Post: 04-30-2009, 07:30 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