Originally posted by RSoles
View Post
- Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
- Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!
Subtotal without subtotalling?
Collapse
X
-
Have tried a couple of times and get the same result - when there was less data it would take around 45 minutes to enter the subtotals so am pretty sure it's just shear volume combined with nested Vlookup functions which I understand take up a lot of processing power -
A Employee ID B Month C Amount D Total for Month (Calc: =IF(AND(A2=A1,B2=B1),0,C2)
1235 1 25.00
1235 1 15.00 40.00
1235 2 25.00 25.00
1235 3 125.00 125.00
2569 2 25.00
2569 2 15.00 40.00
2569 3 300.00
2870 3 25.00 325.00
What I need is a calculation in column E which will sum Column D at each change of reference in column A
I spent ages lining up all those numbers which now look fine whilst I am editing but all group together when I post
Comment
-
I must be reading this wrong, but why not create a pivot table and group on Column A and subtotal that. Would give you the same result. But I am stupid as you can tell by my previous comments.Originally posted by LisaContractorUmbrella View PostA Employee ID B Month C Amount D Total for Month (Calc: =IF(AND(A2=A1,B2=B1),0,C2)
1235 1 25.00
1235 1 15.00 40.00
1235 2 25.00 25.00
1235 3 125.00 125.00
2569 2 25.00
2569 2 15.00 40.00
2569 3 300.00
2870 3 25.00 325.00
What I need is a calculation in column E which will sum Column D at each change of reference in column A
I spent ages lining up all those numbers which now look fine whilst I am editing but all group together when I post

Comment
-
That's fine. Just trying to determine if its all the shear volume of calculations that are causing the problem or a problem with the subtotaling.Originally posted by LisaContractorUmbrella View PostUnfortunately the formulas need to remain
See it as a workaround not a solution.
It could be made into a macro too.McCoy: "Medical men are trained in logic."
Spock: "Trained? Judging from you, I would have guessed it was trial and error."Comment
-
Once I have the figure per reference number I need to enter the same formula in another workbook which then needs to be compared to this one - as far as I know this isn't possible with a pivot table. Plus total data would be 26+ columns and 10000+ rows so I may have the same problem with Excel falling overOriginally posted by woohoo View PostI must be reading this wrong, but why not create a pivot table and group on Column A and subtotal that. Would give you the same result. But I am stupid as you can tell by my previous comments.Comment
-
Might not be able to do it with a formula but easily done with a macro.Originally posted by LisaContractorUmbrella View PostA Employee ID B Month C Amount D Total for Month (Calc: =IF(AND(A2=A1,B2=B1),0,C2)
1235 1 25.00
1235 1 15.00 40.00
1235 2 25.00 25.00
1235 3 125.00 125.00
2569 2 25.00
2569 2 15.00 40.00
2569 3 300.00
2870 3 25.00 325.00
What I need is a calculation in column E which will sum Column D at each change of reference in column A
I spent ages lining up all those numbers which now look fine whilst I am editing but all group together when I post
McCoy: "Medical men are trained in logic."
Spock: "Trained? Judging from you, I would have guessed it was trial and error."Comment
-
There are already 5 macro's attached to the file - that's probably not helpingOriginally posted by lilelvis2000 View PostThat's fine. Just trying to determine if its all the shear volume of calculations that are causing the problem or a problem with the subtotaling.
See it as a workaround not a solution.
It could be made into a macro too.
Comment
-
Comment
-
How familiar are you with loops?Originally posted by LisaContractorUmbrella View Posttell me more
I'm terrible with pseudo code but it will go something like this (I'm sure someone on here will find all sorts of errors and provide a better version.)
var subtotal = 0
var breakValue
//get the first row breakValue and its values
breakvalue = sheet[0][A]
subtotal = sheet[0][D]
sheet[0][E] = subtotal
loop i = 2 to 100 //say
if breakvalue <> sheet[i][A] then
subtotal = 0
breakvalue = sheet[i][A]
end if
subtotal = subtotal + sheet[i][D]
sheet[i][E] = subtotal
next
Something like that will do it.McCoy: "Medical men are trained in logic."
Spock: "Trained? Judging from you, I would have guessed it was trial and error."Comment
-
Not familiar with loops at allOriginally posted by lilelvis2000 View PostHow familiar are you with loops?
I'm terrible with pseudo code but it will go something like this (I'm sure someone on here will find all sorts of errors and provide a better version.)
var subtotal = 0
var breakValue
//get the first row breakValue and its values
breakvalue = sheet[0][A]
subtotal = sheet[0][D]
sheet[0][E] = subtotal
loop i = 2 to 100 //say
if breakvalue <> sheet[i][A] then
subtotal = 0
breakvalue = sheet[i][A]
end if
subtotal = subtotal + sheet[i][D]
sheet[i][E] = subtotal
next
Something like that will do it.
Quite happy to record macro's but not really any good at writing them! Can kind of understand what you've written - will this still work if the number of rows vary? I can't give a definitive end point
Comment
- Home
- News & Features
- First Timers
- IR35 / S660 / BN66
- Employee Benefit Trusts
- Agency Workers Regulations
- MSC Legislation
- Limited Companies
- Dividends
- Umbrella Company
- VAT / Flat Rate VAT
- Job News & Guides
- Money News & Guides
- Guide to Contracts
- Successful Contracting
- Contracting Overseas
- Contractor Calculators
- MVL
- Contractor Expenses
Advertisers
Contractor Services
CUK News
- HMRC loan charge settlement offer: 3 things to check before you sign Today 07:41
- HMRC standstill agreements extended to 72 months: why the term's doubled, and what to check before signing Jul 31 05:53
- Who owns the loans? Inside the mystery of the loan charge recall scandal Jul 30 06:20
- Umbrella company winding-up petitions in 2026: the practical guide for contractors Jul 29 05:29
- Payments on Account deadline: what contractors must do before July 31st — maybe for the final few times Jul 28 08:01
- Andy Burnham's first 100 days: five things contractors need from the new PM Jul 27 00:53
- Starmer vs Burnham on housing: What their rival plans mean for your contractor mortgage Jul 22 00:59
- Burnham's housing vision vs. Starmer's home-buying reforms: what it means for your contractor mortgage Jul 22 00:59
- In Khalil v Innovate Transport, a limited company contractor wasn’t a worker and was on £2.30 — not £230 Jul 21 07:58
- Andy Burnham is PM: 5 new IT policies set to shape UK tech and its contractors Jul 20 06:29


Comment