Thread: If Function
View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Toppers Toppers is offline
external usenet poster
 
Posts: 4,339
Default If Function

Set up table as below in Columns A & B:

A B
1 200
6 400
11 600
16 750
21 1000

If lookup value is in D1 then:

=VLOOKUP(D1,$A$1:$B$5,2,1)

Or to allow for errors:

=IF(iserror(VLOOKUP(D1,$A$1:$B$5,2,1)),"",VLOOKUP( D1,$A$1:$B$5,2,1))

this return blank if error condition arises

HTH

"Trying To Excel" wrote:



"Trying To Excel" wrote:

A B
1-5 $ 200.00
6-10 $400.00
11-15 $ 600.00
16-20 $ 750.00
21-30 $ 1000.00

Question - If the value in a cell in Column A falls within a specified range
then the corresponding $ amount is in Column B.


I phrased my question incorrectly. Cell A1 could have any value in it from 1
to 30. My question is if that value is between lets say 1 and 5 then B1
should be $ 200.00. if it is between 16 and 20 then B1 should be $ 750.00 and
so on.