Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Search for specific number in a range

Good day to all
I'm having trouble figuring out which function i should use to find a
certain range of numbers.
First, i'll explain my problem thoroughly:
In one column I have ranges of numbers filled in cells (example: cell 1: 0 -
50 kgs; cell 2: 51 - 100 kgs; cell 3: 101 - 200 kgs;...) and in the adjacent
column I have the prices which go with the specific weight range. I worked
out this formula:

=VLOOKUP(A2;'Hong Kong seafreight'!A32:B58;2)

in which A2 equals the weight of the cargo entered by a user, so for example
the user enters a weight of 49 kgs, the function has to display the correct
price. A32:B58 is my range in which all my data is contained, and "2" is the
column in which excel can find the prices associated with the range in weight.

Second, my problem:
For example, when i enter a weight of 502 kgs it gives me the price of the
weight category between 5001 - 6000 kgs. But i need the price of the weight
category between 501 - 600 kgs. Can anyone help me point the right direction
to search?
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default Search for specific number in a range

Hi,

Create you table of weight/costs in A32 - B58 looking like this

0 10
51 20
101 30
201 40
301 50
401 60
501 70
etc
Note the table must be sorted by column A
Then use the formula
=VLOOKUP(A2,'Hong Kong seafreight'!A32:B58,2,TRUE)

Mike

"Ruan" wrote:

Good day to all
I'm having trouble figuring out which function i should use to find a
certain range of numbers.
First, i'll explain my problem thoroughly:
In one column I have ranges of numbers filled in cells (example: cell 1: 0 -
50 kgs; cell 2: 51 - 100 kgs; cell 3: 101 - 200 kgs;...) and in the adjacent
column I have the prices which go with the specific weight range. I worked
out this formula:

=VLOOKUP(A2;'Hong Kong seafreight'!A32:B58;2)

in which A2 equals the weight of the cargo entered by a user, so for example
the user enters a weight of 49 kgs, the function has to display the correct
price. A32:B58 is my range in which all my data is contained, and "2" is the
column in which excel can find the prices associated with the range in weight.

Second, my problem:
For example, when i enter a weight of 502 kgs it gives me the price of the
weight category between 5001 - 6000 kgs. But i need the price of the weight
category between 501 - 600 kgs. Can anyone help me point the right direction
to search?

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Count the number of times a cell value is within a specific range Everett Excel Worksheet Functions 4 September 2nd 06 10:54 PM
Search for a number in a table and return data of a specific cell Karaman Excel Discussion (Misc queries) 4 June 30th 06 03:46 PM
How to use an index number in a search range Nick Krill Excel Worksheet Functions 2 January 12th 06 06:16 PM
How do I create a function to search a range for a number and... NECCExcel Excel Worksheet Functions 2 November 18th 05 09:14 PM
How to sum data that is only within a specific number range? ryesworld Excel Worksheet Functions 3 November 15th 05 10:23 PM


All times are GMT +1. The time now is 05:32 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"