Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 216
Default help with a IF formula

If any cell in a range of cells A4:AF4 contain the number 2, pass or fail
if a cell contains a 2 want result to show value of fail

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,358
Default help with a IF formula

Assuming you mean, you have a row, A4:AF4 (32 cells). If any of the cells
have a 2 in it, then FAIL, otherwise pass?

=IF(COUNTIF(A4:AF4,2)0,"FAIL","PASS")

If this isn't what you mean, perhaps rephrase the question.

--
John C


"Nadine" wrote:

If any cell in a range of cells A4:AF4 contain the number 2, pass or fail
if a cell contains a 2 want result to show value of fail

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8
Default help with a IF formula

Try this:

=IF(ISNA(MATCH(2,A4:AF4,0)),"fail","pass")
  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 216
Default help with a IF formula

Yes, Thanks.

Now how do I change it, to show nothing until a cell has been filled in.
Keep cell that contains forumla empty, until it meets the criteria

"John C" wrote:

Assuming you mean, you have a row, A4:AF4 (32 cells). If any of the cells
have a 2 in it, then FAIL, otherwise pass?

=IF(COUNTIF(A4:AF4,2)0,"FAIL","PASS")

If this isn't what you mean, perhaps rephrase the question.

--
John C


"Nadine" wrote:

If any cell in a range of cells A4:AF4 contain the number 2, pass or fail
if a cell contains a 2 want result to show value of fail

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 216
Default help with a IF formula

No they have changed the criteria.

If specific cells containt a 2

K4,L4,P4,Q4,T4,U4,X4


"CurlerBob" wrote:

Try this:

=IF(ISNA(MATCH(2,A4:AF4,0)),"fail","pass")



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9
Default help with a IF formula

For than one way to skin this cat...but I would use the countif formula...

=IF(COUNTIF(A4:AF4,2)0,"FAIL","PASS")


"Nadine" wrote:

If any cell in a range of cells A4:AF4 contain the number 2, pass or fail
if a cell contains a 2 want result to show value of fail

  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9
Default help with a IF formula

IF(OR(K4=2,L4=2,P4=2,Q4=2,T4=2,U4=2,X4=2), "FAIL","PASS")

you could also define a range on those columns and make a better formula.....



"Nadine" wrote:

No they have changed the criteria.

If specific cells containt a 2

K4,L4,P4,Q4,T4,U4,X4


"CurlerBob" wrote:

Try this:

=IF(ISNA(MATCH(2,A4:AF4,0)),"fail","pass")

  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 216
Default help with a IF formula

When you say define a range, do you mean Name a range

"desertres" wrote:

IF(OR(K4=2,L4=2,P4=2,Q4=2,T4=2,U4=2,X4=2), "FAIL","PASS")

you could also define a range on those columns and make a better formula.....



"Nadine" wrote:

No they have changed the criteria.

If specific cells containt a 2

K4,L4,P4,Q4,T4,U4,X4


"CurlerBob" wrote:

Try this:

=IF(ISNA(MATCH(2,A4:AF4,0)),"fail","pass")

  #9   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,358
Default help with a IF formula

=IF(COUNTBLANK(A4:AF4)=32,"",IF(OR(K4=2,L4=2,P4=2, Q4=2,T4=2,U4=2,X4=2),
"FAIL","PASS"))
--
John C


"Nadine" wrote:

Yes, Thanks.

Now how do I change it, to show nothing until a cell has been filled in.
Keep cell that contains forumla empty, until it meets the criteria

"John C" wrote:

Assuming you mean, you have a row, A4:AF4 (32 cells). If any of the cells
have a 2 in it, then FAIL, otherwise pass?

=IF(COUNTIF(A4:AF4,2)0,"FAIL","PASS")

If this isn't what you mean, perhaps rephrase the question.

--
John C


"Nadine" wrote:

If any cell in a range of cells A4:AF4 contain the number 2, pass or fail
if a cell contains a 2 want result to show value of fail

  #10   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 216
Default help with a IF formula

Thanks John C.

I got this working, had to rework it a bit.

=IF(COUNTBLANK(H4:AF4)=25,"",IF(OR(K4=2,L4=2,P4=2, Q4=2,T4=2,U4=2,X4=2),"Yes","No"))


"John C" wrote:

=IF(COUNTBLANK(A4:AF4)=32,"",IF(OR(K4=2,L4=2,P4=2, Q4=2,T4=2,U4=2,X4=2),
"FAIL","PASS"))
--
John C


"Nadine" wrote:

Yes, Thanks.

Now how do I change it, to show nothing until a cell has been filled in.
Keep cell that contains forumla empty, until it meets the criteria

"John C" wrote:

Assuming you mean, you have a row, A4:AF4 (32 cells). If any of the cells
have a 2 in it, then FAIL, otherwise pass?

=IF(COUNTIF(A4:AF4,2)0,"FAIL","PASS")

If this isn't what you mean, perhaps rephrase the question.

--
John C


"Nadine" wrote:

If any cell in a range of cells A4:AF4 contain the number 2, pass or fail
if a cell contains a 2 want result to show value of fail

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



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