Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 155
Default Sumproduct Subtotal #Value! error

Hi

I have a formula that works

=IF(Insurer!C2="Total",
COUNTIF(DATA!J2:J61546,"c"),
SUMPRODUCT((DATA!$D$1:$D$61546=Insurer!C2)*(DATA!$ J$1:$J$61546="c")))

But I have now introduced a filter to the data sheet and I want to use
SUBTOTAL to evaluate the visible records.

The formula works where 'Insurer!C2="Total"' but returns a #VALUE! error
otherwise

=IF(Insurer!C2="Total",
SUMPRODUCT(SUBTOTAL(103,OFFSET(DATA!$A$2:$A$64999, ROW(DATA!$A$2:$A$64999)-MIN(ROW(DATA!$A$2:$A$64999)),,1)),
--(DATA!$J$2:$J$64999="C")),
SUMPRODUCT(SUBTOTAL(103,OFFSET(DATA!$A$2:$A$64999, ROW(DATA!$A$2:$A$64999)-MIN(ROW(DATA!$A$2:$A$64999)),,1)),
--(DATA!$J$2:$J$64999="C"),--(DATA!$D$1:$D$64999=Insurer!C2)))

Any help is appreciated

Graham
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,722
Default Sumproduct Subtotal #Value! error

Your last array is 1 row larger than all the rest (calls out D1:D64999).
Change it to
=IF(Insurer!C2="Total",
SUMPRODUCT(SUBTOTAL(103,OFFSET(DATA!$A$2:$A$64999, ROW(DATA!$A$2:$A$64999)-MIN(ROW(DATA!$A$2:$A$64999)),,1)),
--(DATA!$J$2:$J$64999="C")),
SUMPRODUCT(SUBTOTAL(103,OFFSET(DATA!$A$2:$A$64999, ROW(DATA!$A$2:$A$64999)-MIN(ROW(DATA!$A$2:$A$64999)),,1)),
--(DATA!$J$2:$J$64999="C"),--(DATA!$D$2:$D$64999=Insurer!C2)))

--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"Graham" wrote:

Hi

I have a formula that works

=IF(Insurer!C2="Total",
COUNTIF(DATA!J2:J61546,"c"),
SUMPRODUCT((DATA!$D$1:$D$61546=Insurer!C2)*(DATA!$ J$1:$J$61546="c")))

But I have now introduced a filter to the data sheet and I want to use
SUBTOTAL to evaluate the visible records.

The formula works where 'Insurer!C2="Total"' but returns a #VALUE! error
otherwise

=IF(Insurer!C2="Total",
SUMPRODUCT(SUBTOTAL(103,OFFSET(DATA!$A$2:$A$64999, ROW(DATA!$A$2:$A$64999)-MIN(ROW(DATA!$A$2:$A$64999)),,1)),
--(DATA!$J$2:$J$64999="C")),
SUMPRODUCT(SUBTOTAL(103,OFFSET(DATA!$A$2:$A$64999, ROW(DATA!$A$2:$A$64999)-MIN(ROW(DATA!$A$2:$A$64999)),,1)),
--(DATA!$J$2:$J$64999="C"),--(DATA!$D$1:$D$64999=Insurer!C2)))

Any help is appreciated

Graham

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 155
Default Sumproduct Subtotal #Value! error

DOH!

Thanks for your help Luke
All works fine now

Graham

"Luke M" wrote:

Your last array is 1 row larger than all the rest (calls out D1:D64999).
Change it to
=IF(Insurer!C2="Total",
SUMPRODUCT(SUBTOTAL(103,OFFSET(DATA!$A$2:$A$64999, ROW(DATA!$A$2:$A$64999)-MIN(ROW(DATA!$A$2:$A$64999)),,1)),
--(DATA!$J$2:$J$64999="C")),
SUMPRODUCT(SUBTOTAL(103,OFFSET(DATA!$A$2:$A$64999, ROW(DATA!$A$2:$A$64999)-MIN(ROW(DATA!$A$2:$A$64999)),,1)),
--(DATA!$J$2:$J$64999="C"),--(DATA!$D$2:$D$64999=Insurer!C2)))

--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"Graham" wrote:

Hi

I have a formula that works

=IF(Insurer!C2="Total",
COUNTIF(DATA!J2:J61546,"c"),
SUMPRODUCT((DATA!$D$1:$D$61546=Insurer!C2)*(DATA!$ J$1:$J$61546="c")))

But I have now introduced a filter to the data sheet and I want to use
SUBTOTAL to evaluate the visible records.

The formula works where 'Insurer!C2="Total"' but returns a #VALUE! error
otherwise

=IF(Insurer!C2="Total",
SUMPRODUCT(SUBTOTAL(103,OFFSET(DATA!$A$2:$A$64999, ROW(DATA!$A$2:$A$64999)-MIN(ROW(DATA!$A$2:$A$64999)),,1)),
--(DATA!$J$2:$J$64999="C")),
SUMPRODUCT(SUBTOTAL(103,OFFSET(DATA!$A$2:$A$64999, ROW(DATA!$A$2:$A$64999)-MIN(ROW(DATA!$A$2:$A$64999)),,1)),
--(DATA!$J$2:$J$64999="C"),--(DATA!$D$1:$D$64999=Insurer!C2)))

Any help is appreciated

Graham

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
Another SUMPRODUCT SUBTOTAL question... Bob Phillips[_3_] Excel Worksheet Functions 4 January 19th 09 03:55 PM
Another SUMPRODUCT SUBTOTAL question... Mike H Excel Worksheet Functions 1 January 19th 09 02:57 PM
Sumproduct and subtotal Marcelo Excel Worksheet Functions 1 March 21st 07 03:26 PM
SUMIF SUBTOTAL OR SUMPRODUCT? CHRIS K Excel Worksheet Functions 2 October 20th 05 05:46 PM
Subtotal - Can I use Sumproduct ? guilbj2 Excel Discussion (Misc queries) 4 May 30th 05 10:40 PM


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

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"