PC Review


Reply
Thread Tools Rate Thread

Check if any value in a range is equal to 0

 
 
Daz
Guest
Posts: n/a
 
      31st Oct 2006
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 With Quote
 
 
 
 
=?Utf-8?B?Sk1C?=
Guest
Posts: n/a
 
      31st Oct 2006
=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
>
>

 
Reply With Quote
 
Chad
Guest
Posts: n/a
 
      31st Oct 2006
This should work

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

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 With Quote
 
=?Utf-8?B?Sk1C?=
Guest
Posts: n/a
 
      1st Nov 2006
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","Valid")
>
> 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 With Quote
 
Daz
Guest
Posts: n/a
 
      10th Nov 2006
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","Valid")
> >
> > 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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
A macro to check range and then check another range if falset-then Jim A Microsoft Excel Discussion 2 13th Jan 2009 06:09 PM
How to check for a date range match in one column and then count thevalues equal to in another Jon Microsoft Excel Worksheet Functions 5 18th Jan 2008 11:54 AM
VBA check to see if variable value is odd but not equal to 1 =?Utf-8?B?RGF2ZSBM?= Microsoft Excel Misc 4 21st Nov 2007 01:54 AM
Can i use If to check if a cell is equal to any value in a particular range manan Microsoft Excel Discussion 1 25th May 2006 09:51 AM
Check to see Row Counts are equal CPK Microsoft Access 2 18th Feb 2005 02:04 PM


Features
 

Advertising
 

Newsgroups
 


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