Need help building a formula

cutepal

New Member
Joined
Feb 11, 2016
Messages
6
Hello,

I have a series of names and values assigned to each of these names. I need to add "all" the values assigned to the same name and post this total in each of the rows.

Please see the example below - I have to add all the values from Line amount and Tax amount for each contact and input the total of these values in all the rows. How can I achieve this? Thank you for your help!
ContactNameInvoiceAmountDueLineAmountTaxAmount
Mr White37.5800
Mr White37.5827.362.74
Mr White37.5800
Mr White37.586.80.68
Mr Red1420.2500
Mr Red1420.251163.94116.39
Mr Red1420.25120.412.04
Mr Red1420.256.80.68
Mr Green637.4500
Mr Green637.45518.751.87
Mr Green637.45545.4
Mr Green637.456.80.68
Mr Yellow178.01143.8314.38
Mr Yellow178.0111.21.12
Mr Yellow178.016.80.68
Mr Blue65.4300
Mr Blue65.4347.884.79
Mr Blue65.434.80.48
Mr Blue65.436.80.68
Mr Purple318.12250.825.08
Mr Purple318.1231.63.16
Mr Purple318.126.80.68

<colgroup><col><col><col><col></colgroup><tbody>
</tbody>
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
Hi,

When you say add "all" values, do you mean including Invoice Amount Due?
 
Last edited:
Upvote 0
No...Invoice Amount Due is where we need to input the total of "Line Amount" and "Tax Due". If you see the example for Mr White, all his values of Line amount and Tax Due are added and the final total is inserted in "Invoice Amount Due"
 
Upvote 0
It wasn't clear (to me, anyway) if you wanted separate columns for each total, or 1 total for both, so I did it both ways for you
A​
B​
C​
D​
E​
F​
G​
1​
ContactNameInvoiceAmountDueLineAmountTaxAmountSUMLineSUMTaxSUMBoth
2​
Mr White37.58
0
0
34.16​
3.42​
37.58​
3​
Mr White37.58
27.36
2.74
34.16​
3.42​
37.58​
4​
Mr White37.58
0
0
34.16​
3.42​
37.58​
5​
Mr White37.58
6.8
0.68
34.16​
3.42​
37.58​
6​
Mr Red1420.25
0
0
1291.14​
129.11​
1420.25​
7​
Mr Red1420.25
1163.94
116.39
1291.14​
129.11​
1420.25​
8​
Mr Red1420.25
120.4
12.04
1291.14​
129.11​
1420.25​
9​
Mr Red1420.25
6.8
0.68
1291.14​
129.11​
1420.25​
10​
Mr Green637.45
0
0
579.5​
57.95​
637.45​
11​
Mr Green637.45
518.7
51.87
579.5​
57.95​
637.45​
12​
Mr Green637.45
54
5.4
579.5​
57.95​
637.45​
13​
Mr Green637.45
6.8
0.68
579.5​
57.95​
637.45​
14​
Mr Yellow178.01
143.83
14.38
161.83​
16.18​
178.01​
15​
Mr Yellow178.01
11.2
1.12
161.83​
16.18​
178.01​
16​
Mr Yellow178.01
6.8
0.68
161.83​
16.18​
178.01​
17​
Mr Blue65.43
0
0
59.48​
5.95​
65.43​
18​
Mr Blue65.43
47.88
4.79
59.48​
5.95​
65.43​
19​
Mr Blue65.43
4.8
0.48
59.48​
5.95​
65.43​
20​
Mr Blue65.43
6.8
0.68
59.48​
5.95​
65.43​
21​
Mr Purple318.12
250.8
25.08
289.2​
28.92​
318.12​
22​
Mr Purple318.12
31.6
3.16
289.2​
28.92​
318.12​
23​
Mr Purple318.12
6.8
0.68
289.2​
28.92​
318.12​
E2=SUMIF($A$2:$A$23,$A2,C$2:C$23)
copied down and across to column F
G2=SUMPRODUCT(--($A$2:$A$23=$A2)*(C$2:D$23))
copied down
 
Upvote 0
Oh my god! You are a genius!!! Thank you SO MUCH for your quick response. You have no idea how helpful this formula is to me. I will be saving 2 days of time with this formula. Thank you again!
 
Upvote 0
Hello,

I have a series of names and values assigned to each of these names. I need to add "all" the values assigned to the same name and post this total in each of the rows.

Please see the example below - I have to add all the values from Line amount and Tax amount for each contact and input the total of these values in all the rows. How can I achieve this? Thank you for your help!
ContactNameInvoiceAmountDueLineAmountTaxAmount
Mr White37.5800
Mr White37.5827.362.74
Mr White37.5800
Mr White37.586.80.68
Mr Red1420.2500
Mr Red1420.251163.94116.39
Mr Red1420.25120.412.04
Mr Red1420.256.80.68
Mr Green637.4500
Mr Green637.45518.751.87
Mr Green637.45545.4
Mr Green637.456.80.68
Mr Yellow178.01143.8314.38
Mr Yellow178.0111.21.12
Mr Yellow178.016.80.68
Mr Blue65.4300
Mr Blue65.4347.884.79
Mr Blue65.434.80.48
Mr Blue65.436.80.68
Mr Purple318.12250.825.08
Mr Purple318.1231.63.16
Mr Purple318.126.80.68

<tbody>
</tbody>
theres a function called Subtotal.
highlight your data go to Data [TAB] > Outline > Subtotal.
in the Subtotal Dialog [check the ff] > LineAmount & TaxAmount > Use function: Sum > Click OK
 
Upvote 0
Sir, if I may ask one more question.... Say Column C & D are not next to each other, then I won't be able to use the sum formula of (c$2:D$23), right? If Line amount is in Column C and Tax Amount is in Column Y, how do I combine the values from these two columns?
 
Upvote 0
I think I figured it out - thank you, once again.

=SUMPRODUCT(--($A$2:$A$23=$A2)*(C$2:C$23+Y$2:Y$23))
 
Upvote 0
(there is probably a complex way to do this with 1 formula, but this is simpler) Use my 1st suggestion then...
E2=SUMIF($A$2:$A$23,$A2,C$2:C$23)

You would then need to use that twice and add them together
=SUMIF($A$2:$A$23,$A2,C$2:C$23)+SUMIF($A$2:$A$23,$A2,Y$2:Y$23)
If needed, you could use full-column references...
=SUMIF($A:$A,$A2,C:C)+SUMIF($A:$A,$A2,Y:Y)
 
Upvote 0

Forum statistics

Threads
1,215,054
Messages
6,122,895
Members
449,097
Latest member
dbomb1414

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