Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 18
Default Sumproduct igoring hidden value

Hi,
How can I use sumproduct function and igore hidden value. The function usage
likes below:
=sumproduct((range1=criteria1)*(rang2=criterial2)* rang4), and I am using
filter on range3.
I expect the function result can igore the any hidden value I made on range 3.

P.S. each range is one column with same row number.

Thanks,
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,520
Default Sumproduct igoring hidden value

With data from row1 to row10 try the below...sum col C based on two
conditions in A and B

=SUMPRODUCT(SUBTOTAL(3,OFFSET(C1:C10,ROW(C1:C10)-MIN(
ROW(C1:C10)),0,1)),--(A1:A10="a")*(B1:B10="b"),C1:C10)


If this post helps click Yes
---------------
Jacob Skaria


"Edward Wang" wrote:

Hi,
How can I use sumproduct function and igore hidden value. The function usage
likes below:
=sumproduct((range1=criteria1)*(rang2=criterial2)* rang4), and I am using
filter on range3.
I expect the function result can igore the any hidden value I made on range 3.

P.S. each range is one column with same row number.

Thanks,

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,058
Default Sumproduct igoring hidden value

First enter the following User Defined FUnction in a standard module:

Public Function visi(rr As Range) As Variant
'''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''''''''''''''
' rr must be a column or piece of a column
'''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''''''''''''''
Application.Volatile
Dim r As Range
Dim v()
ReDim v(1 To rr.Count)
i = 1
For Each r In rr
If r.EntireRow.Hidden = False Then
v(i) = 1
Else
v(i) = 0
End If
i = i + 1
Next
visi = Application.Transpose(v)
End Function

The function will return 0 if the row is hidden, otherwise 1

Then something like:

=SUMPRODUCT((A1:A100=1)*(B1:B100="pass")*(visi(C1: C100)))

can be used. This allows SUMPRODUCT to be used on an AutoFiltered table.
--
Gary''s Student - gsnu200908


"Edward Wang" wrote:

Hi,
How can I use sumproduct function and igore hidden value. The function usage
likes below:
=sumproduct((range1=criteria1)*(rang2=criterial2)* rang4), and I am using
filter on range3.
I expect the function result can igore the any hidden value I made on range 3.

P.S. each range is one column with same row number.

Thanks,

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 18
Default Sumproduct igoring hidden value

Yes it really works. I used "Subtotal" twice to cover two columns with auto
filters.
Thanks!


"Jacob Skaria" wrote:

With data from row1 to row10 try the below...sum col C based on two
conditions in A and B

=SUMPRODUCT(SUBTOTAL(3,OFFSET(C1:C10,ROW(C1:C10)-MIN(
ROW(C1:C10)),0,1)),--(A1:A10="a")*(B1:B10="b"),C1:C10)


If this post helps click Yes
---------------
Jacob Skaria


"Edward Wang" wrote:

Hi,
How can I use sumproduct function and igore hidden value. The function usage
likes below:
=sumproduct((range1=criteria1)*(rang2=criterial2)* rang4), and I am using
filter on range3.
I expect the function result can igore the any hidden value I made on range 3.

P.S. each range is one column with same row number.

Thanks,

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
2007 Worksheet, Hidden Columns, .CSV Format Saves Hidden Column Da Tammy Excel Discussion (Misc queries) 3 April 2nd 09 11:40 PM
Copy and Paste with hidden columns remaining hidden Pendelfin Excel Discussion (Misc queries) 2 February 26th 09 11:35 AM
SUMPRODUCT with Hidden Columns Steven Excel Worksheet Functions 3 May 7th 07 09:03 PM
SUMPRODUCT with Hidden Columns Steven Excel Worksheet Functions 0 May 7th 07 07:39 PM
Hidden Columns No Longer Hidden after Copying Worksheet? EV Nelson Excel Discussion (Misc queries) 1 December 6th 06 05:10 PM


All times are GMT +1. The time now is 09:58 AM.

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"