Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / February 2006

Tip: Looking for answers? Try searching our database.

is there an "if for each"?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
M John - 28 Feb 2006 14:15 GMT
Hello,
I'm trying to do a 'check' formula.  There is a column of data I want to
report on in a separate cell.  In the case where all the data is the
same....say each cell in the column contains "1", is there an if-then formula
that I can use to get:

(in excel-ese:)

=if(each cell in column x = 1,good,bad)

Many thanks,
MJ
Chip Pearson - 28 Feb 2006 14:24 GMT
Try a formula like

=IF(COUNTIF(A1:A3,1)=COUNT(A1:A3),TRUE,FALSE)

Signature

Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com

> Hello,
> I'm trying to do a 'check' formula.  There is a column of data
[quoted text clipped - 11 lines]
> Many thanks,
> MJ
M John - 28 Feb 2006 14:37 GMT
Perfect.  Most appreciated.

> Try a formula like
>
[quoted text clipped - 15 lines]
> > Many thanks,
> > MJ
Andrew Taylor - 28 Feb 2006 15:21 GMT
I hesitate to correct Chip, but you should use COUNTA
instead of COUNT if the cells aren't guaranteed to contain
numbers.

For a terser (but equivalent) version, try
=COUNTIF(A1:A3,1)=COUNTA(A1:A3)

or
=AND(A1:A3=1)
entered as an array formula (Ctrl-Shift-enter)

(I've just noticed that if any of the cells contain error values then
only my first formula above gives the correct answer)

Andrew Taylor

> Perfect.  Most appreciated.
>
[quoted text clipped - 24 lines]
> > > Many thanks,
> > > MJ
Antonio Elinon - 28 Feb 2006 14:32 GMT
Normally, in a "check" situation you would know how many items you are
checking, so you should be able to use, presuming bad is 0:

=if(sum(X:X) = 25,"good","bad")

> Hello,
> I'm trying to do a 'check' formula.  There is a column of data I want to
[quoted text clipped - 8 lines]
> Many thanks,
> MJ
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.