Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 29
Default Comparing a cell value to a range

Is there a function to see if the value of a cell appears in a range of cells?

I want to see if the value of cell A1 appears in any cell B1:B5. In other
words, if my sheet is such:
351 | 219
000 | 183
000 | 281
000 | 351 <-----
000 | 186
.... I should get a TRUE return.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 698
Default Comparing a cell value to a range

Hi Paladin,

Try this,

=COUNTIF(B1:B5,A1)1

HTH
Regards,
Howard

"PaladinWhite" wrote in message
...
Is there a function to see if the value of a cell appears in a range of
cells?

I want to see if the value of cell A1 appears in any cell B1:B5. In other
words, if my sheet is such:
351 | 219
000 | 183
000 | 281
000 | 351 <-----
000 | 186
... I should get a TRUE return.



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Comparing a cell value to a range

In say, C1: =IF(A1="","",ISNUMBER(MATCH(A1,B$1:B$5,0)))
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"PaladinWhite" wrote:
Is there a function to see if the value of a cell appears in a range of cells?

I want to see if the value of cell A1 appears in any cell B1:B5. In other
words, if my sheet is such:
351 | 219
000 | 183
000 | 281
000 | 351 <-----
000 | 186
... I should get a TRUE return.

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 698
Default Comparing a cell value to a range

Hi again Paladin,

Big woops, sorry. Try this:

=IF(COUNTIF(B1:B5,A1)0,"True","False")

HTH
Regards,
Howard

"PaladinWhite" wrote in message
...
Is there a function to see if the value of a cell appears in a range of
cells?

I want to see if the value of cell A1 appears in any cell B1:B5. In other
words, if my sheet is such:
351 | 219
000 | 183
000 | 281
000 | 351 <-----
000 | 186
... I should get a TRUE return.



  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,091
Default Comparing a cell value to a range

=COUNTIF(B1:B5,A1)
The formula returns the number of times the value in A1 occurs in B1:B5
So, if you don't need the count, but just TRUE or FALSE then:
=IF(COUNTIF(B1:B5,A1),TRUE,FALSE)

Tyro

"PaladinWhite" wrote in message
...
Is there a function to see if the value of a cell appears in a range of
cells?

I want to see if the value of cell A1 appears in any cell B1:B5. In other
words, if my sheet is such:
351 | 219
000 | 183
000 | 281
000 | 351 <-----
000 | 186
... I should get a TRUE return.





  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 896
Default Comparing a cell value to a range

another way:

=MATCH(A1;B1:B5,)
if you receive an error then there is no such value in B1:B5


=IF(MATCH(A1,B1:B5,),"True","")
if you receive an "empty" cell then tehere in such value in B1:B5


On 24 Mar, 00:45, PaladinWhite
wrote:
Is there a function to see if the value of a cell appears in a range of cells?

I want to see if the value of cell A1 appears in any cell B1:B5. In other
words, if my sheet is such:
351 | 219
000 | 183
000 | 281
000 | 351 <-----
000 | 186
... I should get a TRUE return.


  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 896
Default Comparing a cell value to a range

another way:

=MATCH(A1;B1:B5,)
if you receive an error then there is no such value in B1:B5


=IF(MATCH(A1,B1:B5,),"True","")
if you receive an "empty" cell then tehere in such value in B1:B5



On 24 Mar, 00:45, PaladinWhite
wrote:
Is there a function to see if the value of a cell appears in a range of cells?

I want to see if the value of cell A1 appears in any cell B1:B5. In other
words, if my sheet is such:
351 | 219
000 | 183
000 | 281
000 | 351 <-----
000 | 186
... I should get a TRUE return.


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
Comparing to a range and printing value Alyssa M Excel Discussion (Misc queries) 4 February 25th 08 07:57 PM
comparing one to one cell within range caroline Excel Worksheet Functions 3 January 29th 08 08:37 PM
Comparing One Range and Adding Another statusquo Excel Worksheet Functions 3 December 9th 05 01:54 AM
Comparing a Range of Values jpx Excel Discussion (Misc queries) 4 November 22nd 05 10:28 PM
Comparing a cell result with a pre-defined value range Antony Weldon Excel Worksheet Functions 1 November 23rd 04 11:51 AM


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

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

About Us

"It's about Microsoft Excel"