Autofill with the SUM of data when the same value is met in a separate column

Pettor

Board Regular
Joined
Aug 8, 2015
Messages
175
Hello guys,

I have a new project where I would like excel to autofill in the third column the sum of the second column when the value in the first column is the same.
i.e. When the value is A, the third column to get the sum of all the previous values of column B.

The different values in column A are thousands.

Is it possible? Is it possible also MS Access to do the same?

Many thanks


ValuesValuesAuto Fill
A
1​
1​
A
0​
1​
B
1​
1​
B
0​
1​
A
0​
1​
A
1​
2​
C
1​
1​
C
0​
1​
A
1​
3​
B
0​
1​
B
0​
1​
C
1​
2​
C
1​
3​
C
0​
3​
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
Is this what you mean?
Book1
ABC
1ValuesValuesAuto Fill
2A11
3A01
4B11
5B01
6A01
7A12
8C11
9C01
10A13
11B01
12B01
13C12
14C13
15C03
Sheet1
Cell Formulas
RangeFormula
C2:C15C2=SUMIF($A$2:A2,A2,$B$2:B2)
 
Upvote 0
T
This could work for a limited number of values in column A but in my case there are thousands different values and new ones are added constantly. O need something that could work autonomously.
There's no reason why it wouldn't work with any number of different values. Try it and see.
 
Upvote 0
My problem is that with this formula I get the same number in every row (column 3) while I would like to get the progressive sum, row by row (Column 4). Am I doing something wrong?

Thanks

SelectionValuesFormulaDesired
A
1,20​
5,11​
1,20​
A
-1,00​
5,11​
0,20​
A
0,95​
5,11​
1,15​
A
-1,00​
5,11​
0,15​
A
0,84​
5,11​
0,99​
A
-1,00​
5,11​
-0,01​
A
0,52​
5,11​
0,51​
A
1,27​
5,11​
1,78​
A
1,18​
5,11​
2,96​
A
0,65​
5,11​
3,61​
A
1,25​
5,11​
4,86​
A
-1,00​
5,11​
3,86​
A
-1,00​
5,11​
2,86​
A
3,25​
5,11​
6,11​
A
-1,00​
5,11​
5,11​
 
Upvote 0
I can't see your formula, so I can't comment on whether it's correct or not. Make sure the first cell of the criteria and values ranges are absolute references, by which I mean (for example) $A$1:A1 and not A1:A1
 
Upvote 0
No, the formula works like a charm! It was my mistake! You are amazing! Does this work also in MS Access?

Many thanks!
 
Upvote 0
No, the formula works like a charm! It was my mistake! You are amazing! Does this work also in MS Access?

Many thanks!
Glad I could help & thanks for the feedback. I know next to nothing about Access so unfortunately I can't help you there.
 
Upvote 0
Hi Kevin,

Is it also possible to be done, matching values from two columns? i.e. Column A has the name and column B has the surname, so when these two are the same to make the calculation?

Many thanks
 
Upvote 0

Forum statistics

Threads
1,215,429
Messages
6,124,838
Members
449,193
Latest member
MikeVol

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top