Thread: If Function
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
RagDyeR RagDyeR is offline
external usenet poster
 
Posts: 3,572
Default If Function

OR ... include the list in the formula itself so that no separate datalist
is necessary:

=LOOKUP(A1,{0,1,6,11,16,21;0,200,400,600,750,1000} )

--
HTH,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------
"Toppers" wrote in message
...
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.