Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 18
Default How to return a value if a range (not a cell) contains a certain v

In following an audit program steps a condition may result as "OK", "N",
"NA", or "Y". I have a table with areas down the left and tests across the
top:

A B C D H
Test1 Test2 Test3 etc. PASS/FAIL
1 Area1 OK OK Y FAIL
2 Area2 OK OK OK PASS
etc

I want the conditional function in the PASS/FAIL cells (H1, H2, etc) to look
through the row to the left and return "FAIL" if there is any cell with "Y"
in it, else "PASS".

How do I get the range as the criteria range, not just one cell? I can get
it to work if I say IF(A1="Y","FAIL","PASS"), but not
IF(A1:G1="Y","FAIL","PASS").
So, I need the test to iterate through a range for the given condition, and
return the value I seek if ever it encounters the trigger criteria.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,311
Default How to return a value if a range (not a cell) contains a certain v

One way:

=IF(COUNTIF(A1:G1,"Y")0,"Fail","PASS")

HTH,
Paul

"Clem" wrote in message
...
In following an audit program steps a condition may result as "OK", "N",
"NA", or "Y". I have a table with areas down the left and tests across
the
top:

A B C D H
Test1 Test2 Test3 etc. PASS/FAIL
1 Area1 OK OK Y FAIL
2 Area2 OK OK OK PASS
etc

I want the conditional function in the PASS/FAIL cells (H1, H2, etc) to
look
through the row to the left and return "FAIL" if there is any cell with
"Y"
in it, else "PASS".

How do I get the range as the criteria range, not just one cell? I can get
it to work if I say IF(A1="Y","FAIL","PASS"), but not
IF(A1:G1="Y","FAIL","PASS").
So, I need the test to iterate through a range for the given condition,
and
return the value I seek if ever it encounters the trigger criteria.



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,118
Default How to return a value if a range (not a cell) contains a certain v

Try this:

H2: =IF(COUNTIF(A2:D2,"Y"),"FAIL","PASS")

Adjust range references to suit your situation.

Does that help?
***********
Regards,
Ron

XL2002, WinXP


"Clem" wrote:

In following an audit program steps a condition may result as "OK", "N",
"NA", or "Y". I have a table with areas down the left and tests across the
top:

A B C D H
Test1 Test2 Test3 etc. PASS/FAIL
1 Area1 OK OK Y FAIL
2 Area2 OK OK OK PASS
etc

I want the conditional function in the PASS/FAIL cells (H1, H2, etc) to look
through the row to the left and return "FAIL" if there is any cell with "Y"
in it, else "PASS".

How do I get the range as the criteria range, not just one cell? I can get
it to work if I say IF(A1="Y","FAIL","PASS"), but not
IF(A1:G1="Y","FAIL","PASS").
So, I need the test to iterate through a range for the given condition, and
return the value I seek if ever it encounters the trigger criteria.

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 380
Default How to return a value if a range (not a cell) contains a certain v

=IF(COUNTIF(A1:G1,"Y")0,"FAIL","PASS")

--

HTH

Bob Phillips

(replace xxxx in the email address with gmail if mailing direct)

"Clem" wrote in message
...
In following an audit program steps a condition may result as "OK", "N",
"NA", or "Y". I have a table with areas down the left and tests across

the
top:

A B C D H
Test1 Test2 Test3 etc. PASS/FAIL
1 Area1 OK OK Y FAIL
2 Area2 OK OK OK PASS
etc

I want the conditional function in the PASS/FAIL cells (H1, H2, etc) to

look
through the row to the left and return "FAIL" if there is any cell with

"Y"
in it, else "PASS".

How do I get the range as the criteria range, not just one cell? I can get
it to work if I say IF(A1="Y","FAIL","PASS"), but not
IF(A1:G1="Y","FAIL","PASS").
So, I need the test to iterate through a range for the given condition,

and
return the value I seek if ever it encounters the trigger criteria.



  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
rml rml is offline
external usenet poster
 
Posts: 50
Default How to return a value if a range (not a cell) contains a certain v

i just wonder what happen @ "N" or "NA" since it may not mean "OK"...

"Clem" wrote:

In following an audit program steps a condition may result as "OK", "N",
"NA", or "Y". I have a table with areas down the left and tests across the
top:

A B C D H
Test1 Test2 Test3 etc. PASS/FAIL
1 Area1 OK OK Y FAIL
2 Area2 OK OK OK PASS
etc

I want the conditional function in the PASS/FAIL cells (H1, H2, etc) to look
through the row to the left and return "FAIL" if there is any cell with "Y"
in it, else "PASS".

How do I get the range as the criteria range, not just one cell? I can get
it to work if I say IF(A1="Y","FAIL","PASS"), but not
IF(A1:G1="Y","FAIL","PASS").
So, I need the test to iterate through a range for the given condition, and
return the value I seek if ever it encounters the trigger criteria.



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 18
Default How to return a value if a range (not a cell) contains a certa

Good question. I didn't set up the criteria, but am evolving the meaning of
these categories. "N" means the test was not done or no exception found, so
the answer should not be "FAIL", and "NA" means there were no instances of
the condition to test, so we again would not choose "FAIL," and again "PASS"
is appropriate.
It's not exactly intuitive, I agree.

Thanks for asking.
clem

"rml" wrote:

i just wonder what happen @ "N" or "NA" since it may not mean "OK"...

"Clem" wrote:

In following an audit program steps a condition may result as "OK", "N",
"NA", or "Y". I have a table with areas down the left and tests across the
top:

A B C D H
Test1 Test2 Test3 etc. PASS/FAIL
1 Area1 OK OK Y FAIL
2 Area2 OK OK OK PASS
etc

I want the conditional function in the PASS/FAIL cells (H1, H2, etc) to look
through the row to the left and return "FAIL" if there is any cell with "Y"
in it, else "PASS".

How do I get the range as the criteria range, not just one cell? I can get
it to work if I say IF(A1="Y","FAIL","PASS"), but not
IF(A1:G1="Y","FAIL","PASS").
So, I need the test to iterate through a range for the given condition, and
return the value I seek if ever it encounters the trigger criteria.

  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
rml rml is offline
external usenet poster
 
Posts: 50
Default How to return a value if a range (not a cell) contains a certa

Yah Clem...since you are doing an AUDIT PROGRAM....the way mostly this is
done is thru a pessimistic rather than optimistic approach.....You may have a
complete non-test "N" yet the result is already pre-defined as PASS...It may
be striking for an auditor...hope u got the real point...

"rml" wrote:

i just wonder what happen @ "N" or "NA" since it may not mean "OK"...

"Clem" wrote:

In following an audit program steps a condition may result as "OK", "N",
"NA", or "Y". I have a table with areas down the left and tests across the
top:

A B C D H
Test1 Test2 Test3 etc. PASS/FAIL
1 Area1 OK OK Y FAIL
2 Area2 OK OK OK PASS
etc

I want the conditional function in the PASS/FAIL cells (H1, H2, etc) to look
through the row to the left and return "FAIL" if there is any cell with "Y"
in it, else "PASS".

How do I get the range as the criteria range, not just one cell? I can get
it to work if I say IF(A1="Y","FAIL","PASS"), but not
IF(A1:G1="Y","FAIL","PASS").
So, I need the test to iterate through a range for the given condition, and
return the value I seek if ever it encounters the trigger criteria.

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
Urgent date/scheduling calc needed jct Excel Worksheet Functions 3 February 24th 06 01:36 AM
need to Copy or Move to active cell from specified range kaream Excel Discussion (Misc queries) 2 December 14th 05 08:12 AM
Match function...random search? Les Excel Worksheet Functions 10 July 28th 05 11:54 AM
Can I use formulas that return cell range ref. in charts X series cwilliams Charts and Charting in Excel 4 June 3rd 05 03:08 PM
Formula to return ADDRESS of cell in range that meets criteria Christie Excel Worksheet Functions 1 March 4th 05 11:13 PM


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