Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default 2 level subtotal result weird

refer to below sample.
I do a subtotal on column ID1, then subtotal again on ID2.
the result looks weird:
row 11 shows b total and row 12 shows y total, it should be the other way
round.
same apply to row 16 (c total) and row 17 (y total) etc.

pls advice. thanks !

ID1 ID2 amt
a x 1
b x 2
b x 3
b x 4
b y 5
b y 6
c x 7
c y 8
d x 9
d y 10


  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 506
Default 2 level subtotal result weird

If you want to Total the C1 to C11 values based on two criteria that is the
text B in A1 to A11 and the text Y in B1 to B11 then use the below one:
=SUMPRODUCT((A1:A11="B")*(B1:B11="Y"),(C1:C11))

The below one will check the character B in A1:A11 and character X in B1:B11
and get the total from C1:C11
=SUMPRODUCT((A1:A11="B")*(B1:B11="X"),(C1:C11))

Like the above change the text in the above formula to get your desired data.

Instead of mentioning the value in the formula you can refer it on some
other cell and get the data by mentioning the values in the particular cells.
See the below one
=SUMPRODUCT((A1:A11=D1)*(B1:B11=E1),(C1:C11))
Now Mention the Text in D1 and E1 to get the totals.

Remember to Click Yes, if this post helps!

--------------------
(Ms-Exl-Learner)
--------------------


"HFLo" wrote:

refer to below sample.
I do a subtotal on column ID1, then subtotal again on ID2.
the result looks weird:
row 11 shows b total and row 12 shows y total, it should be the other way
round.
same apply to row 16 (c total) and row 17 (y total) etc.

pls advice. thanks !

ID1 ID2 amt
a x 1
b x 2
b x 3
b x 4
b y 5
b y 6
c x 7
c y 8
d x 9
d y 10


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,939
Default 2 level subtotal result weird

What you have described is the default behaviour of subtotals. Since ID2 is
your second subtotal it shows up after (below) ID1. If I was doing that I
would have used a pivot table to render this...

Sum of amt
ID1 ID2 Total
a x 1
a Total 1
b x 9
y 11
b Total 20
c x 7
y 8
c Total 15
d x 9
y 10
d Total 19
Grand Total 55


Which I think is in line with what you want...
--
HTH...

Jim Thomlinson


"HFLo" wrote:

refer to below sample.
I do a subtotal on column ID1, then subtotal again on ID2.
the result looks weird:
row 11 shows b total and row 12 shows y total, it should be the other way
round.
same apply to row 16 (c total) and row 17 (y total) etc.

pls advice. thanks !

ID1 ID2 amt
a x 1
b x 2
b x 3
b x 4
b y 5
b y 6
c x 7
c y 8
d x 9
d y 10


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
level buttons not visible for subtotal Gerry[_4_] Excel Discussion (Misc queries) 2 November 5th 08 07:07 PM
subtotals showing 0 in summary level// 2 subtotal levels KM Excel Discussion (Misc queries) 2 July 12th 08 10:46 PM
Unhide column based on subtotal level open. Gilbert Excel Discussion (Misc queries) 0 September 17th 07 08:00 PM
copy visble cells at the subtotal level jfkosu Excel Worksheet Functions 2 March 31st 05 01:57 AM
Array formula weird result Solerman Kaplon via OfficeKB.com Excel Discussion (Misc queries) 2 December 21st 04 08:39 PM


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