Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
JohnD
 
Posts: n/a
Default how to use the IF formula with a range of cells

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.
  #2   Report Post  
Posted to microsoft.public.excel.misc
Gizmo63
 
Posts: n/a
Default how to use the IF formula with a range of cells

Hi John,

=IF(SUMPRODUCT(--(B2:B999=J2)),"Ordered", "Not Ordered")

HTH

Giz

"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.

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

=IF(ISNA(VLOOKUP(J2,B:B,1,FALSE)),"Not Ordered","Ordered")

Vaya con Dios,
Chuck, CABGx3



"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.

  #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.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Formula for % of "yes" in range of cells? npw Excel Worksheet Functions 1 April 25th 06 12:38 AM
dynamically select a range of cells for use in a formula isofuncurves Excel Worksheet Functions 1 February 2nd 06 01:34 AM
Match then lookup Tenacity Excel Worksheet Functions 9 December 3rd 05 05:30 AM
Formula Problem - interrupted by #VALUE! in other cells!? Ted Excel Worksheet Functions 17 November 25th 05 05:18 PM
Formula help for using a range of cells! Sukismomma Excel Worksheet Functions 5 January 27th 05 02:34 AM


All times are GMT +1. The time now is 03:29 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"