Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Daz Daz is offline
external usenet poster
 
Posts: 7
Default Check if any value in a range is equal to 0

Hi all.

Quick question.

I have several cells - i.e M8 : M12. These cells can contain integers 0
to 10.

I want to be able to design a formula that says - if any cell in the
range M8:M12 contains a 0 then change the value of M13 to say
"INVALID", otherwise it is "VALID".

I'm having a bit of trouble designing this - tried nest IF statements
and formula.

Suggestions appreciated.

Regards
Daz

  #2   Report Post  
Posted to microsoft.public.excel.programming
JMB JMB is offline
external usenet poster
 
Posts: 2,062
Default Check if any value in a range is equal to 0

=IF(COUNTIF(M8:M12,0), "Invalid", "Valid")

"Daz" wrote:

Hi all.

Quick question.

I have several cells - i.e M8 : M12. These cells can contain integers 0
to 10.

I want to be able to design a formula that says - if any cell in the
range M8:M12 contains a 0 then change the value of M13 to say
"INVALID", otherwise it is "VALID".

I'm having a bit of trouble designing this - tried nest IF statements
and formula.

Suggestions appreciated.

Regards
Daz


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 49
Default Check if any value in a range is equal to 0

This should work

=IF(OR(M8=0,M9=0,M10=0,M11=0,M12=0),"Invalid","Val id")

Chad


Daz wrote:
Hi all.

Quick question.

I have several cells - i.e M8 : M12. These cells can contain integers 0
to 10.

I want to be able to design a formula that says - if any cell in the
range M8:M12 contains a 0 then change the value of M13 to say
"INVALID", otherwise it is "VALID".

I'm having a bit of trouble designing this - tried nest IF statements
and formula.

Suggestions appreciated.

Regards
Daz


  #4   Report Post  
Posted to microsoft.public.excel.programming
JMB JMB is offline
external usenet poster
 
Posts: 2,062
Default Check if any value in a range is equal to 0

If you are open to a suggestion, I think you could shorten it to
=IF(OR(M8:M12=0),"Invalid","Valid")

array entered with Cntrl+Shift+Enter (or you get #VALUE).


"Chad" wrote:

This should work

=IF(OR(M8=0,M9=0,M10=0,M11=0,M12=0),"Invalid","Val id")

Chad


Daz wrote:
Hi all.

Quick question.

I have several cells - i.e M8 : M12. These cells can contain integers 0
to 10.

I want to be able to design a formula that says - if any cell in the
range M8:M12 contains a 0 then change the value of M13 to say
"INVALID", otherwise it is "VALID".

I'm having a bit of trouble designing this - tried nest IF statements
and formula.

Suggestions appreciated.

Regards
Daz



  #5   Report Post  
Posted to microsoft.public.excel.programming
Daz Daz is offline
external usenet poster
 
Posts: 7
Default Check if any value in a range is equal to 0

Thanks for these very helpful suggestions.


JMB wrote:
If you are open to a suggestion, I think you could shorten it to
=IF(OR(M8:M12=0),"Invalid","Valid")

array entered with Cntrl+Shift+Enter (or you get #VALUE).


"Chad" wrote:

This should work

=IF(OR(M8=0,M9=0,M10=0,M11=0,M12=0),"Invalid","Val id")

Chad


Daz wrote:
Hi all.

Quick question.

I have several cells - i.e M8 : M12. These cells can contain integers 0
to 10.

I want to be able to design a formula that says - if any cell in the
range M8:M12 contains a 0 then change the value of M13 to say
"INVALID", otherwise it is "VALID".

I'm having a bit of trouble designing this - tried nest IF statements
and formula.

Suggestions appreciated.

Regards
Daz




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
How to check for a date range match in one column and then count thevalues equal to in another Jon[_6_] Excel Worksheet Functions 5 January 18th 08 11:54 AM
to check if the values in two sheets are equal SKP Excel Discussion (Misc queries) 1 November 29th 07 01:50 PM
VBA check to see if variable value is odd but not equal to 1 Dave L[_2_] Excel Discussion (Misc queries) 4 November 21st 07 01:54 AM
check if 2 cells are equal but only if they contain numbers not i. Peter Boardman Excel Worksheet Functions 4 April 17th 05 08:16 PM
check if 2 cells are equal but only if they contain numbers not i. Peter Boardman Excel Worksheet Functions 2 April 17th 05 08:13 PM


All times are GMT +1. The time now is 10:15 PM.

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"