Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 921
Default If Statement / Array

Hello,

I have data in columns A, B, and C. In column D, I would like a formula
that sums the contents of A1:C1, but only if none of the cells contains a
zero. In other words, if all the cells are greater than zero, return the
sum. If one of the cells has a figure of zero, return zero.

Help?! TIA
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default If Statement / Array

One way:

=(COUNTIF(A1:C1,0)=0)*SUM(A1:C1)

Empty cells are ignored.

--
Biff
Microsoft Excel MVP


"JEFF" wrote in message
...
Hello,

I have data in columns A, B, and C. In column D, I would like a formula
that sums the contents of A1:C1, but only if none of the cells contains a
zero. In other words, if all the cells are greater than zero, return the
sum. If one of the cells has a figure of zero, return zero.

Help?! TIA



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,069
Default If Statement / Array

Try this in D1:

=IF(OR(A1=0,B1=0,C1=0),0,SUM(A1:C1))

Hope this helps,

Hutch

"JEFF" wrote:

Hello,

I have data in columns A, B, and C. In column D, I would like a formula
that sums the contents of A1:C1, but only if none of the cells contains a
zero. In other words, if all the cells are greater than zero, return the
sum. If one of the cells has a figure of zero, return zero.

Help?! TIA

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default If Statement / Array

Try,

=SUM(IF(MIN(A1:C1)0,A1:C1))

Mike

"JEFF" wrote:

Hello,

I have data in columns A, B, and C. In column D, I would like a formula
that sums the contents of A1:C1, but only if none of the cells contains a
zero. In other words, if all the cells are greater than zero, return the
sum. If one of the cells has a figure of zero, return zero.

Help?! TIA

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 921
Default If Statement / Array

It does, thanks.... Was wondering if I had 100 columns instead of three,
what my approach would be.....

Thanks again

"Tom Hutchins" wrote:

Try this in D1:

=IF(OR(A1=0,B1=0,C1=0),0,SUM(A1:C1))

Hope this helps,

Hutch

"JEFF" wrote:

Hello,

I have data in columns A, B, and C. In column D, I would like a formula
that sums the contents of A1:C1, but only if none of the cells contains a
zero. In other words, if all the cells are greater than zero, return the
sum. If one of the cells has a figure of zero, return zero.

Help?! TIA



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4
Default If Statement / Array

what if i have a formula, lets say 1+a , whereby i need to get the sum of
this "1+a" for a = 1 to 20??
  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default If Statement / Array

Try this:

=SUMPRODUCT(1+ROW(INDIRECT("1:20")))

--
Biff
Microsoft Excel MVP


"carrol" wrote in message
...
what if i have a formula, lets say 1+a , whereby i need to get the sum of
this "1+a" for a = 1 to 20??



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
IF statement with 2 array formulae nathan_savidge Excel Worksheet Functions 1 April 22nd 08 02:47 PM
Array, Formula, Constant, IF Statement Question???? SayWhatAuto Excel Discussion (Misc queries) 4 January 1st 07 09:36 PM
IF statement in Array Formula's sdg8481 Excel Discussion (Misc queries) 7 July 24th 06 12:49 PM
Searching for a criteria in array of cells within an IF statement selvaraj Excel Worksheet Functions 1 July 28th 05 03:36 PM
Array If statement doesn't work Suzanne Excel Worksheet Functions 5 December 3rd 04 09:19 AM


All times are GMT +1. The time now is 05:54 PM.

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"