+ Reply to Thread
Results 1 to 9 of 9

Value Ranges

  1. #1
    Registered User
    Join Date
    01-14-2010
    Location
    Orlando, Florida
    MS-Off Ver
    Excel 2007
    Posts
    4

    Value Ranges

    Here is my issue, I want to redo an Excel spreadsheet to input a price value onto page A from a value range from Page B based on a gallon value from Page A.

    Example:

    Let's say the spreadsheet defines a need for 56 gallons of a product. I want the spreadsheet to take that value and run it through the range on Page B and find the price per gallon based on the number of gallons needed and input it back into a different cell on Page A.

    Please let me know if I need to clarify this further. Any and all help is welcome.

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,038

    Re: Value Ranges

    Use VLOOKUP function.
    For more about it check Excel Help.
    Never use Merged Cells in Excel

  3. #3
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Value Ranges

    Try Vlookup

    eg.

    =Vlookup(A1,Sheet2!A:B,2,FALSE)

    where A1 is the gallons to lookup up in column A of Sheet2 and return value from column B of Sheet2

    If the gallons in the table are listed in numerical ascending order.. then this will be faster and easier

    =Lookup(A1,Sheet2!A:B)

    where values are as previous..
    Last edited by NBVC; 01-14-2010 at 02:56 PM.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  4. #4
    Registered User
    Join Date
    01-14-2010
    Location
    Orlando, Florida
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Value Ranges

    The problem is that the value for the amount of gallons needed could be in the millions; I dont want to have to make Page B with 2 million+ cells. I want it to do something like:

    Range (In Gallons) Price Per Gallon
    >55 $356
    55-275 $245.45
    276-1100 $218.18
    1101-2200 $190.90
    2201+ $163.63

  5. #5
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,038

    Re: Value Ranges

    Yes...

    Book2.xls

    Try to look somewhere how VLOOKUP works (you'll find it very usefull)...

    For example: http://www.youtube.com/watch?v=GZX2iXfqALs
    Last edited by zbor; 01-14-2010 at 04:50 PM.

  6. #6
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Value Ranges

    You can still use:

    =Lookup(A1,Sheet2!A:B)

    Just put the lower bound values in column A... don't need the Upper Bounds

    eg.
    A B
    0 356
    55 245.45
    276 218.18
    1101 190.90
    2210 163.63

  7. #7
    Registered User
    Join Date
    01-14-2010
    Location
    Orlando, Florida
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Value Ranges

    Thanks! I'll give it a go and let you know.

  8. #8
    Registered User
    Join Date
    01-14-2010
    Location
    Orlando, Florida
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Value Ranges

    It's working! Thanks guys! I guess the part I was unaware of was that I didn't have to define the upper bounds of the range.

  9. #9
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,038

    Re: Value Ranges

    Beware, when you don't look for exact matches numbers must be sorted in ascending order!

+ 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