Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Stuck on simple formula

Status
Not open for further replies.

inkserious

Technical User
Jul 26, 2006
67
I'm stuck on what would normally seem to be a simple formula. I have a table: column A contains minimum values: 0, 2.4, 2.8, 3.8, and 4.5. Column B contains maximum values of 2.39, 2.79, 3.79, 4.49 and 5 respectively. Column C contains corresponding percentages: 0.0%, 0.0%, 2.0%, 2.5% and 3.0% respectively.

Column A Column B Column C
[tt]0[/tt][tab][tab][tab][tab][tt]2.39[/tt][tab][tab][tab][tt]0.0%[/tt]
[tt]2.4[/tt][tab][tab][tab][tt]2.79[/tt][tab][tab][tab][tt]0.0%[/tt]
[tt]2.8[/tt][tab][tab][tab][tt]3.79[/tt][tab][tab][tab][tt]2.0%[/tt]
[tt]3.8[/tt][tab][tab][tab][tt]4.49[/tt][tab][tab][tab][tt]2.5%[/tt][tt]
4.5[/tt][tab][tab][tab][tt]5.0[/tt][tab][tab][tab][tt]3.0%[/tt]

I need to look up a number whose value is greater than or equal to a number in column A and whose value is less than or equal to the corresponding value in column B and then return the percentage value in column C. For example, 3.25 would be between 2.8 and 3.79 so it would return 2.0%; 3.8 would be between 3.8 and 4.49 so it would return 2.5%, etc.

Thanks for any help you can provide.

-ep
 
A simple vlookup will do it, without any need for column B entries, like this:
=VLOOKUP(E3,A2:C6,3,TRUE)

Cheers, Glenn.

Beauty is in the eye of the beerholder.
 
You don't need column 'C'. Assuming existing table structure:
=VLOOKUP(3,25,A1:C5,3)

combo
 
One detailed bit of different behaviour between the simple look-up and the problem as originally described: given a value of 2.395, the look-up will return 0.0%, while the original description wouldn't return anything. I assume you don't have entries with more than two decimal places.
 
Thanks everyone. I knew I was making it more difficult than it really was.

lionelhill, I will not have any values with more than two decimal places.

Thanks again.

-ep
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top