Thread: Custom Function
View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
Trevor Shuttleworth Trevor Shuttleworth is offline
external usenet poster
 
Posts: 1,089
Default Custom Function

{=IF((SUM((F1=C$2:C$5)*(F1<=D$2:D$5))0), "found","not found")}

Array Entered again

Note that this is *not* case sensitive, whereas your data appears to be. Is
that important ?

The function I wrote treats "b" and "B" differently ... do you care ?

Regards

Trevor


"Martin" wrote in message
...
I tried your suggestion and it seems to do what I want. I tried to use
this
formula as part of an IF statement and get an error. I included the curly
braces around the array formula inside the IF

Can this array formula be used inside an IF?

Thanks.

"Randy Harmelink" wrote:

You could just use an array formula:

=(SUM((J9=G$10:G$13)*(J9<=H$10:H$13))0)

.....where J9 is the value you are testing and G10:G13 are the lower
table values and H10:H13 are the upper table values.

Martin wrote:
I am in the process of trying to create a Function that will take a
value and
determine if it appears in a table of ranges. For example, my table of
ranges may be:
Lower Upper
10000 15000
30000 35000
A C
g i

If I use a value of 11000, my function would return a 1 since it is in
one
of the ranges. A value of d would return a 0.