View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.misc
CC
 
Posts: n/a
Default how to use the IF formula with a range of cells

if is to compare Cells with text try this
=IF(OR(EXACT(A1,H1:H9)),"Not ordered"," ordered")

"The formula in the example must be entered as an array formula (array
formula: A formula that performs multiple calculations on one or more sets of
values, and then returns either a single result or multiple results. Array
formulas are enclosed between braces { }, and are entered by pressing
CTRL+SHIFT+ENTER.). After copying the example to a blank worksheet, select
each formula cell individually. Press F2, and then press CTRL+SHIFT+ENTER. If
the formula is not entered as an array formula, the error #VALUE! is returned.

The formula above uses the following syntax:

=OR(EXACT(TestValue, CompareRange))

TestValue refers to a cell containing a user-entered value; CompareRange
refers to a list of text values to be compared against.

cc




"JohnD" wrote:

I have a text in one cell (J2) and have to compare it with text in a range of
cells (B2:B999) to return an expression if true. I have tried using the IF
function e.g
IF(J2=B2:B28,"Ordered","Not Ordered"), but it doesn't appear to like working
with a range of cell, works fine if you I point it to a single cell. Any help
would be appreciated.