Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi all, I have an excel with the following format. I have to find out
subtotal of the each date column. The empty date column should be considered under the group of previous column having date. Please help Date Amount A1 B1 C1 01.01.2010 2000 Cumi.Sum -200 -300 -1500 0.00 10.01.2010 500 -300 -200 0.00 20.01.2010 700 -200 500.00 30.01.2010 400 -400 0.00 With thanks and regards Pol |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
If you have valid excel dates in ColA the below will work. In cell C1 enter
the below and copy down as required. =IF(B1="",SUM(OFFSET(A1,0,1,-(ROW()-MATCH(9^9,$A$1:A1)+1))),"") -- Jacob "pol" wrote: Hi all, I have an excel with the following format. I have to find out subtotal of the each date column. The empty date column should be considered under the group of previous column having date. Please help Date Amount A1 B1 C1 01.01.2010 2000 Cumi.Sum -200 -300 -1500 0.00 10.01.2010 500 -300 -200 0.00 20.01.2010 700 -200 500.00 30.01.2010 400 -400 0.00 With thanks and regards Pol |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Many thanks for the reply.
I cannot apply that formula , I am looking for a macro to subtotal automatically the cumilative column of the last row of the group data. Also the date column cannot considered as date column format. But it would be a text column and group. Please help "Jacob Skaria" wrote: If you have valid excel dates in ColA the below will work. In cell C1 enter the below and copy down as required. =IF(B1="",SUM(OFFSET(A1,0,1,-(ROW()-MATCH(9^9,$A$1:A1)+1))),"") -- Jacob "pol" wrote: Hi all, I have an excel with the following format. I have to find out subtotal of the each date column. The empty date column should be considered under the group of previous column having date. Please help Date Amount A1 B1 C1 01.01.2010 2000 Cumi.Sum -200 -300 -1500 0.00 10.01.2010 500 -300 -200 0.00 20.01.2010 700 -200 500.00 30.01.2010 400 -400 0.00 With thanks and regards Pol |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Try this macro
Sub MyMacro() Dim lngRow As Long, varSum As Variant For lngRow = 1 To Cells(Rows.Count, "B").End(xlUp).Row + 1 If Range("B" & lngRow) < "" Then varSum = varSum + Range("B" & lngRow) Else Range("C" & lngRow) = varSum: varSum = 0 End If Next End Sub -- Jacob "pol" wrote: Many thanks for the reply. I cannot apply that formula , I am looking for a macro to subtotal automatically the cumilative column of the last row of the group data. Also the date column cannot considered as date column format. But it would be a text column and group. Please help "Jacob Skaria" wrote: If you have valid excel dates in ColA the below will work. In cell C1 enter the below and copy down as required. =IF(B1="",SUM(OFFSET(A1,0,1,-(ROW()-MATCH(9^9,$A$1:A1)+1))),"") -- Jacob "pol" wrote: Hi all, I have an excel with the following format. I have to find out subtotal of the each date column. The empty date column should be considered under the group of previous column having date. Please help Date Amount A1 B1 C1 01.01.2010 2000 Cumi.Sum -200 -300 -1500 0.00 10.01.2010 500 -300 -200 0.00 20.01.2010 700 -200 500.00 30.01.2010 400 -400 0.00 With thanks and regards Pol |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Thanks for the reply Jacob But still have some problem. There is no any blank
line between each group. I have to write the cumilative sum just before starting the net row. The next group will start Just after the previous group data ends. I thnk the follwing will macors will work lastrow = Range("B" & Rows.Count).End(xlUp).Row currow = ActiveCell.Row Col_A = "" For RowCount = 1 To lastrow If RowCount = currow Then If Range("A" & RowCount) = "" Or Range("A" & RowCount) = 0 Then Range("A" & RowCount) = Col_A Else Col_A = Range("A" & RowCount) End If End If Next RowCount Range("A1").Select Range(Selection, Selection.End(xlToRight)).Select Range(Selection, Selection.End(xlDown)).Select Selection.Subtotal GroupBy:=1, Function:=xlSum, TotalList:=Array(24), _ Replace:=True, PageBreaks:=False, SummaryBelowData:=True Please advice me With thanks and regards Pol "Jacob Skaria" wrote: Try this macro Sub MyMacro() Dim lngRow As Long, varSum As Variant For lngRow = 1 To Cells(Rows.Count, "B").End(xlUp).Row + 1 If Range("B" & lngRow) < "" Then varSum = varSum + Range("B" & lngRow) Else Range("C" & lngRow) = varSum: varSum = 0 End If Next End Sub -- Jacob "pol" wrote: Many thanks for the reply. I cannot apply that formula , I am looking for a macro to subtotal automatically the cumilative column of the last row of the group data. Also the date column cannot considered as date column format. But it would be a text column and group. Please help "Jacob Skaria" wrote: If you have valid excel dates in ColA the below will work. In cell C1 enter the below and copy down as required. =IF(B1="",SUM(OFFSET(A1,0,1,-(ROW()-MATCH(9^9,$A$1:A1)+1))),"") -- Jacob "pol" wrote: Hi all, I have an excel with the following format. I have to find out subtotal of the each date column. The empty date column should be considered under the group of previous column having date. Please help Date Amount A1 B1 C1 01.01.2010 2000 Cumi.Sum -200 -300 -1500 0.00 10.01.2010 500 -300 -200 0.00 20.01.2010 700 -200 500.00 30.01.2010 400 -400 0.00 With thanks and regards Pol |
#6
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I assume you meant something like that:
=IF(AND(A1="",A2<""),SUM(OFFSET(A1,0,1,-(ROW()-MATCH(9^9,$A$1:A1)+1))),"") Micky "Jacob Skaria" wrote: If you have valid excel dates in ColA the below will work. In cell C1 enter the below and copy down as required. =IF(B1="",SUM(OFFSET(A1,0,1,-(ROW()-MATCH(9^9,$A$1:A1)+1))),"") -- Jacob "pol" wrote: Hi all, I have an excel with the following format. I have to find out subtotal of the each date column. The empty date column should be considered under the group of previous column having date. Please help Date Amount A1 B1 C1 01.01.2010 2000 Cumi.Sum -200 -300 -1500 0.00 10.01.2010 500 -300 -200 0.00 20.01.2010 700 -200 500.00 30.01.2010 400 -400 0.00 With thanks and regards Pol |
#7
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi Micky
I thought there is a blank row between each sections and hence the +1 in the formula.. Even so that should have been AND(A1="",A2<""), to avoid calculations after the data....Thanks for pointing that out... -- Jacob "מיכאל (מיקי) אבידן" wrote: I assume you meant something like that: =IF(AND(A1="",A2<""),SUM(OFFSET(A1,0,1,-(ROW()-MATCH(9^9,$A$1:A1)+1))),"") Micky "Jacob Skaria" wrote: If you have valid excel dates in ColA the below will work. In cell C1 enter the below and copy down as required. =IF(B1="",SUM(OFFSET(A1,0,1,-(ROW()-MATCH(9^9,$A$1:A1)+1))),"") -- Jacob "pol" wrote: Hi all, I have an excel with the following format. I have to find out subtotal of the each date column. The empty date column should be considered under the group of previous column having date. Please help Date Amount A1 B1 C1 01.01.2010 2000 Cumi.Sum -200 -300 -1500 0.00 10.01.2010 500 -300 -200 0.00 20.01.2010 700 -200 500.00 30.01.2010 400 -400 0.00 With thanks and regards Pol |
#8
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi Pol I have just put up a file for you at:-
http://www.pierrefondes.com/ It is item number 56 towards the top of my home page. This file is prepared in EXCEL 2007. 1. I have copied your data into Sheet2. 2. In Sheet2 you will notice that I have changed column A so that dates appear in all of the rows. 3. Now take the following action in Sheet2:- - highlight A1:B12 - Data / Outline group / Subtotal / Subtotal pane should launch. 4. The Subtotal pop up window should now appear as follows:- (i) At each change in: Date (ii) Use function: Sum (iii) Add subtotal to: Amount The above field should have a tick in the box on the left. 5. Click OK in the above window. Adjust column widths. You should now get the subtotals that you require. If my comments have helped please hit Yes. Thanks. "pol" wrote: Hi all, I have an excel with the following format. I have to find out subtotal of the each date column. The empty date column should be considered under the group of previous column having date. Please help Date Amount A1 B1 C1 01.01.2010 2000 Cumi.Sum -200 -300 -1500 0.00 10.01.2010 500 -300 -200 0.00 20.01.2010 700 -200 500.00 30.01.2010 400 -400 0.00 With thanks and regards Pol |
#9
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Pol,
Take a good look he http://www.microsoft.com/office/comm...152&sloc=en-us Micky "pol" wrote: Hi all, I have an excel with the following format. I have to find out subtotal of the each date column. The empty date column should be considered under the group of previous column having date. Please help Date Amount A1 B1 C1 01.01.2010 2000 Cumi.Sum -200 -300 -1500 0.00 10.01.2010 500 -300 -200 0.00 20.01.2010 700 -200 500.00 30.01.2010 400 -400 0.00 With thanks and regards Pol |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
sort macro, subtotal and add lines after subtotal | Excel Discussion (Misc queries) | |||
Trying to find easy way to copy 400K rows of data from Subtotal | New Users to Excel | |||
pasting to subtotal lines without replacing hidden -non-subtotal l | Excel Discussion (Misc queries) | |||
Bolding the subtotal lines automaticlly When using the Subtotal fu | New Users to Excel | |||
Subtotal of Subtotal displays Grand Total in wrong row | Excel Worksheet Functions |