#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 52
Default auto suming

i have the data in this format

name Jan Feb Wed
alan 5 10 15
ben 6 0 3


others 5 10 5
others 1 2 2

what i want is to do 3 suming..one is after the list of name i want it to do
a sum then after which is sum for others. finally do a sum for both name and
other. this is what it shld look like.

name jan feb march
alan 5 10 15
ben 6 0 3
sum 11 10 18

other 5 10 15
other 1 2 2
sum 6 12 17
total 17 22 35

is that a way to do this?

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,646
Default auto suming

Use a helper column, (say E), insert a header in E1 (say "control"), insert
formula =IF(A2="others",A2,"name") in E2 and drag it down as necessary, then
Data/Subtotals/Group by: control, Function: Sum, Columns to sum:
Jan,Feb,Wed/OK

Regards,
Stefi



€˛violet€¯ ezt Ć*rta:

i have the data in this format

name Jan Feb Wed
alan 5 10 15
ben 6 0 3


others 5 10 5
others 1 2 2

what i want is to do 3 suming..one is after the list of name i want it to do
a sum then after which is sum for others. finally do a sum for both name and
other. this is what it shld look like.

name jan feb march
alan 5 10 15
ben 6 0 3
sum 11 10 18

other 5 10 15
other 1 2 2
sum 6 12 17
total 17 22 35

is that a way to do this?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 52
Default auto suming

m i able to hide this control column? another thing is that hw i can write my
own heading. because it will auto write bla bla sub total..but that nt what i
want..

"Stefi" wrote:

Use a helper column, (say E), insert a header in E1 (say "control"), insert
formula =IF(A2="others",A2,"name") in E2 and drag it down as necessary, then
Data/Subtotals/Group by: control, Function: Sum, Columns to sum:
Jan,Feb,Wed/OK

Regards,
Stefi



€˛violet€¯ ezt Ć*rta:

i have the data in this format

name Jan Feb Wed
alan 5 10 15
ben 6 0 3


others 5 10 5
others 1 2 2

what i want is to do 3 suming..one is after the list of name i want it to do
a sum then after which is sum for others. finally do a sum for both name and
other. this is what it shld look like.

name jan feb march
alan 5 10 15
ben 6 0 3
sum 11 10 18

other 5 10 15
other 1 2 2
sum 6 12 17
total 17 22 35

is that a way to do this?

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,646
Default auto suming

1. Yes, you can hide the control column.
2. This is your result table (before hiding the control column):
name Jan Feb Wed control
alan 5 10 15 name
ben 6 0 3 name
11 10 18 name Subtotal
others 5 10 5 others
others 1 2 2 others
6 12 7 others Subtotal
17 22 25 Total

As you can see, it writes the words in Subtotal rows that you used in the
=IF(A2="others",A2,"name") function.

If you hide the control column, the result will be displayed like that:

name Jan Feb Wed
alan 5 10 15
ben 6 0 3
11 10 18
others 5 10 5
others 1 2 2
6 12 7
17 22 25

Regards,
Stefi

€˛violet€¯ ezt Ć*rta:

m i able to hide this control column? another thing is that hw i can write my
own heading. because it will auto write bla bla sub total..but that nt what i
want..

"Stefi" wrote:

Use a helper column, (say E), insert a header in E1 (say "control"), insert
formula =IF(A2="others",A2,"name") in E2 and drag it down as necessary, then
Data/Subtotals/Group by: control, Function: Sum, Columns to sum:
Jan,Feb,Wed/OK

Regards,
Stefi



€˛violet€¯ ezt Ć*rta:

i have the data in this format

name Jan Feb Wed
alan 5 10 15
ben 6 0 3


others 5 10 5
others 1 2 2

what i want is to do 3 suming..one is after the list of name i want it to do
a sum then after which is sum for others. finally do a sum for both name and
other. this is what it shld look like.

name jan feb march
alan 5 10 15
ben 6 0 3
sum 11 10 18

other 5 10 15
other 1 2 2
sum 6 12 17
total 17 22 35

is that a way to do this?

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 52
Default auto suming

it actually nv generate name subtotal or what..it become other field sub
total. anyway is that a way of using vba to code it? cos i want this step to
be done in a click.

"Stefi" wrote:

1. Yes, you can hide the control column.
2. This is your result table (before hiding the control column):
name Jan Feb Wed control
alan 5 10 15 name
ben 6 0 3 name
11 10 18 name Subtotal
others 5 10 5 others
others 1 2 2 others
6 12 7 others Subtotal
17 22 25 Total

As you can see, it writes the words in Subtotal rows that you used in the
=IF(A2="others",A2,"name") function.

If you hide the control column, the result will be displayed like that:

name Jan Feb Wed
alan 5 10 15
ben 6 0 3
11 10 18
others 5 10 5
others 1 2 2
6 12 7
17 22 25

Regards,
Stefi

€˛violet€¯ ezt Ć*rta:

m i able to hide this control column? another thing is that hw i can write my
own heading. because it will auto write bla bla sub total..but that nt what i
want..

"Stefi" wrote:

Use a helper column, (say E), insert a header in E1 (say "control"), insert
formula =IF(A2="others",A2,"name") in E2 and drag it down as necessary, then
Data/Subtotals/Group by: control, Function: Sum, Columns to sum:
Jan,Feb,Wed/OK

Regards,
Stefi



€˛violet€¯ ezt Ć*rta:

i have the data in this format

name Jan Feb Wed
alan 5 10 15
ben 6 0 3


others 5 10 5
others 1 2 2

what i want is to do 3 suming..one is after the list of name i want it to do
a sum then after which is sum for others. finally do a sum for both name and
other. this is what it shld look like.

name jan feb march
alan 5 10 15
ben 6 0 3
sum 11 10 18

other 5 10 15
other 1 2 2
sum 6 12 17
total 17 22 35

is that a way to do this?



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,646
Default auto suming

Yes:
Sub SubTot()
Range("E1").Value = "Controls"
lastrow = Columns("A").Find(What:="*", _
After:=Range("A1"), _
LookAt:=xlPart, _
LookIn:=xlValues, _
SearchOrder:=xlByRows, _
SearchDirection:=xlPrevious, _
MatchCase:=False).Row
Range("E2").Formula = "=IF(A2=""others"",A2,""name"") "
Range("E2").AutoFill Destination:=Range("E2:E" & lastrow),
Type:=xlFillDefault
Range("A1").Select
Selection.Subtotal GroupBy:=5, Function:=xlSum, TotalList:=Array(2, 3,
4), _
Replace:=True, PageBreaks:=False, SummaryBelowData:=True
Columns("E:E").EntireColumn.Hidden = True
End Sub

Regards,
Stefi



€˛violet€¯ ezt Ć*rta:

it actually nv generate name subtotal or what..it become other field sub
total. anyway is that a way of using vba to code it? cos i want this step to
be done in a click.

"Stefi" wrote:

1. Yes, you can hide the control column.
2. This is your result table (before hiding the control column):
name Jan Feb Wed control
alan 5 10 15 name
ben 6 0 3 name
11 10 18 name Subtotal
others 5 10 5 others
others 1 2 2 others
6 12 7 others Subtotal
17 22 25 Total

As you can see, it writes the words in Subtotal rows that you used in the
=IF(A2="others",A2,"name") function.

If you hide the control column, the result will be displayed like that:

name Jan Feb Wed
alan 5 10 15
ben 6 0 3
11 10 18
others 5 10 5
others 1 2 2
6 12 7
17 22 25

Regards,
Stefi

€˛violet€¯ ezt Ć*rta:

m i able to hide this control column? another thing is that hw i can write my
own heading. because it will auto write bla bla sub total..but that nt what i
want..

"Stefi" wrote:

Use a helper column, (say E), insert a header in E1 (say "control"), insert
formula =IF(A2="others",A2,"name") in E2 and drag it down as necessary, then
Data/Subtotals/Group by: control, Function: Sum, Columns to sum:
Jan,Feb,Wed/OK

Regards,
Stefi



€˛violet€¯ ezt Ć*rta:

i have the data in this format

name Jan Feb Wed
alan 5 10 15
ben 6 0 3


others 5 10 5
others 1 2 2

what i want is to do 3 suming..one is after the list of name i want it to do
a sum then after which is sum for others. finally do a sum for both name and
other. this is what it shld look like.

name jan feb march
alan 5 10 15
ben 6 0 3
sum 11 10 18

other 5 10 15
other 1 2 2
sum 6 12 17
total 17 22 35

is that a way to do this?

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
suming under two condintions Soccerboy83 Excel Discussion (Misc queries) 2 October 28th 09 01:27 AM
suming working ok but now not auto updating totals after changes colin bellamy Excel Discussion (Misc queries) 1 March 16th 08 11:09 PM
testing while suming angryelvis New Users to Excel 3 August 14th 07 05:58 PM
suming in add-ins ajimmo Excel Worksheet Functions 2 October 2nd 06 11:57 PM
suming across sheets netnews.comcast.net Excel Programming 1 July 15th 04 08:23 PM


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