Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Lee IT
 
Posts: n/a
Default Can a formula check for a certain value in a range?

I need a formula function to check if a named range contains a certain entry.
A formula similar to: IF(DATA!Dave='computer',d16,""), where DATA is the
worksheet and Dave is the named range. But, rather than '=' I need a
function that checks if the range 'contains' a single or a number of
'computer' entrys in the range. The quantity of entrys is unimportant.

The Range:
The named range is a number of rows, of which the first column is merged to
contain the name of the person the rest of the data refers to. The data can
contain numbers, text or blank cells - relevant to the column headers.

I'm sure this must be possible!!!?
  #2   Report Post  
galimi
 
Posts: n/a
Default

You can write a custom function similar to the following:

function contains (rngnm,cmpr)

for each cl in range(rngrm)

if cl.value = cmpr then

contains=true
exit function

end if
next
end function

http://HelpExcel.com

"Lee IT" wrote:

I need a formula function to check if a named range contains a certain entry.
A formula similar to: IF(DATA!Dave='computer',d16,""), where DATA is the
worksheet and Dave is the named range. But, rather than '=' I need a
function that checks if the range 'contains' a single or a number of
'computer' entrys in the range. The quantity of entrys is unimportant.

The Range:
The named range is a number of rows, of which the first column is merged to
contain the name of the person the rest of the data refers to. The data can
contain numbers, text or blank cells - relevant to the column headers.

I'm sure this must be possible!!!?

  #3   Report Post  
Jack Sons
 
Posts: n/a
Default

Use this formula

=IF(COUNTIF(your_range,"computer"),D16,"")

Jack Sons
The Netherlands


"Lee IT" schreef in bericht
...
I need a formula function to check if a named range contains a certain
entry.
A formula similar to: IF(DATA!Dave='computer',d16,""), where DATA is the
worksheet and Dave is the named range. But, rather than '=' I need a
function that checks if the range 'contains' a single or a number of
'computer' entrys in the range. The quantity of entrys is unimportant.

The Range:
The named range is a number of rows, of which the first column is merged
to
contain the name of the person the rest of the data refers to. The data
can
contain numbers, text or blank cells - relevant to the column headers.

I'm sure this must be possible!!!?



  #4   Report Post  
Lee IT
 
Posts: n/a
Default


Thanks - I have used this method before with a similar custom formula
function required problem. The code was given to me via a forum also.

I have copied this to Visual Basic Editor and saved it as a module. I
don't know VB macro code very well so I'm not sure how to adjust it if
I so need to. Would the formula then look something like this?

=IF(DATA!AOAcontains"Computer",D20,"")

galimi Wrote:
You can write a custom function similar to the following:

function contains (rngnm,cmpr)

for each cl in range(rngrm)

if cl.value = cmpr then

contains=true
exit function

end if
next
end function

http://HelpExcel.com

"Lee IT" wrote:
-
I need a formula function to check if a named range contains a certain
entry.
A formula similar to: IF(DATA!Dave='computer',d16,""), where DATA is
the
worksheet and Dave is the named range. But, rather than '=' I need a
function that checks if the range 'contains' a single or a number of
'computer' entrys in the range. The quantity of entrys is
unimportant.

The Range:
The named range is a number of rows, of which the first column is
merged to
contain the name of the person the rest of the data refers to. The
data can
contain numbers, text or blank cells - relevant to the column
headers.

I'm sure this must be possible!!!?-



--
Lee IT
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
Trying to enter a range of numbers using >1 and < 5 in a formula Mel9970 Excel Worksheet Functions 1 March 29th 05 08:52 PM
How do I set up a formula with a check box? Russell-stanely Excel Discussion (Misc queries) 2 January 28th 05 07:17 PM
use a date range as criteria in a countif formula mbparks Excel Worksheet Functions 3 January 2nd 05 11:06 PM
How to populate formula in range of vertical cells to next colum Robert Excel Worksheet Functions 0 November 17th 04 05:09 AM
how do i use the sum if formula with a date range? zach f Excel Worksheet Functions 10 November 12th 04 01:34 AM


All times are GMT +1. The time now is 06:12 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"