View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ron Coderre
 
Posts: n/a
Default Determine if Cell Address is within a Range

It CAN be done...Here's what I did:

1)
A12: a1
A13: a5

2)I created a dynamic range called rngTest
which refers to: =INDIRECT(Sheet1!$A$12&":"&Sheet1!$A$13)

3)Populate E1:E5 with numbers

4) G1: =AND(B1=MIN(E1:E5), ISNUMBER(ROW(B1 rngTest)))

Note the space between B1 and rngTest....that attempts to create an
intersection between B1 and the range rngTest. If there's no interesection,
then there's no row number.

Does that help?

***********
Regards,
Ron

XL2002, WinXP-Pro


"John Michl" wrote:

I'm trying to create a conditional format that will highlight a cell if
two conditions are met one of which is that the cell is found within a
dynamic range.

Is there a function or formula I could use to determine if, say, cell
B1 is within the range A1:D1? If so, I could use a conditional format
like the following:

= AND(B1=Min(E1:E5), B1 is in the Range A1:D1)

It may look funny but there are certain times that the range will
change from A1:D1 to C1 or B1 based on the data entered elsewhere in
the table.

Thanks.

- John