Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 30
Default Issue with SUMPRODUCT leaving a 0 value in cell

Howdy All,

I have a spreadsheet that contains a couple instances of a formula similar
to this one:

=IF(SUMPRODUCT(--($C$4:C4=C4))1,"",SUMPRODUCT(--(C4:$C$501=C4),H4:$H$501))

The formula works great, with one exception.

It leaves a 0 value in the cell below the last instance.

This interferes with an AVERAGE formula that I am running on a column.

Any ideas on how to either eliminate the 0 value, or modify my AVERAGE
formula to not count the 0 value?

Thanks,
Brian


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4,393
Default Issue with SUMPRODUCT leaving a 0 value in cell

Leave out the cell below "last instance" (what ever that means) when
computing the average?
--
Bernard V Liengme
www.stfx.ca/people/bliengme
remove caps from email

"Brian" wrote in message
.. .
Howdy All,

I have a spreadsheet that contains a couple instances of a formula similar
to this one:

=IF(SUMPRODUCT(--($C$4:C4=C4))1,"",SUMPRODUCT(--(C4:$C$501=C4),H4:$H$501))

The formula works great, with one exception.

It leaves a 0 value in the cell below the last instance.

This interferes with an AVERAGE formula that I am running on a column.

Any ideas on how to either eliminate the 0 value, or modify my AVERAGE
formula to not count the 0 value?

Thanks,
Brian



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 30
Default Issue with SUMPRODUCT leaving a 0 value in cell

Sorry for the confusion.

But this spreadsheet has info continually added to it.
And in the row below the last entry, the value of that formula displays a 0.
And I average the entire column because the end row is undefined (always
increasing).



"Bernard Liengme" wrote in message
...
Leave out the cell below "last instance" (what ever that means) when
computing the average?
--
Bernard V Liengme
www.stfx.ca/people/bliengme
remove caps from email

"Brian" wrote in message
.. .
Howdy All,

I have a spreadsheet that contains a couple instances of a formula
similar to this one:

=IF(SUMPRODUCT(--($C$4:C4=C4))1,"",SUMPRODUCT(--(C4:$C$501=C4),H4:$H$501))

The formula works great, with one exception.

It leaves a 0 value in the cell below the last instance.

This interferes with an AVERAGE formula that I am running on a column.

Any ideas on how to either eliminate the 0 value, or modify my AVERAGE
formula to not count the 0 value?

Thanks,
Brian





  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Issue with SUMPRODUCT leaving a 0 value in cell

Try something like this, array-entered (press CTRL+SHIFT+ENTER):
=AVERAGE(IF(H4:H5010,H4:H501))

We can't use entire col references.
If necessary, use something close, like this:
=AVERAGE(IF(H4:H655360,H4:H65536))
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"Brian" wrote in message
...
Sorry for the confusion.

But this spreadsheet has info continually added to it.
And in the row below the last entry, the value of that formula displays a
0.
And I average the entire column because the end row is undefined (always
increasing).



  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 208
Default Issue with SUMPRODUCT leaving a 0 value in cell

=IF( OR( C4 = "", COUNTIF( $C$4:C4, C4 ) 1 ), "", SUMIF( C4:$C$501, C4,
H4:$H$501 ) )

--
Regards,
Luc.

"Festina Lente"


"Brian" wrote:

Howdy All,

I have a spreadsheet that contains a couple instances of a formula similar
to this one:

=IF(SUMPRODUCT(--($C$4:C4=C4))1,"",SUMPRODUCT(--(C4:$C$501=C4),H4:$H$501))

The formula works great, with one exception.

It leaves a 0 value in the cell below the last instance.

This interferes with an AVERAGE formula that I am running on a column.

Any ideas on how to either eliminate the 0 value, or modify my AVERAGE
formula to not count the 0 value?

Thanks,
Brian





  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 52
Default Issue with SUMPRODUCT leaving a 0 value in cell

The formula

=IF(SUMPRODUCT(--($C$4:C4=C4))1,"",SUMPRODUCT(--(C4:$C$501=C4),H4:$H$501))

is too expensive. Invoke instead:

=SUMIF(C4:$C$501,C4,H4:$H$501)

If necessary:

=IF(COUNTIF($C$4:C4,C4)1,"",SUMIF(C4:$C$501,C4,H4 :$H$501))

The average formula can be modified to excluse 0's...

=AVERAGE(IF(Range0,Range)

confirmed with control+shift+enter.

Brian wrote:
Howdy All,

I have a spreadsheet that contains a couple instances of a formula similar
to this one:

=IF(SUMPRODUCT(--($C$4:C4=C4))1,"",SUMPRODUCT(--(C4:$C$501=C4),H4:$H$501))

The formula works great, with one exception.

It leaves a 0 value in the cell below the last instance.

This interferes with an AVERAGE formula that I am running on a column.

Any ideas on how to either eliminate the 0 value, or modify my AVERAGE
formula to not count the 0 value?

Thanks,
Brian


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
Cell References [email protected] Excel Discussion (Misc queries) 2 November 15th 06 11:37 PM
Using an offset formula for the reference in a relative reference Cuda Excel Worksheet Functions 6 November 15th 06 05:12 PM
Compiling macro based on cell values simonsmith Excel Discussion (Misc queries) 1 May 16th 06 08:31 PM
Help with this conditional IF statement C-Dawg Excel Discussion (Misc queries) 3 May 15th 06 06:01 PM
Possible Lookup Table Karen Excel Worksheet Functions 5 June 8th 05 09:43 PM


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