Sumproduct formula with Right formula

NatiTavor

New Member
Joined
Mar 10, 2021
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Hi,
I need to sum ammount A and ammount B under "main code" where the connection is thru "shortened code" and "code" (shortened code is the right 5 digits of code)
The explanation is in the file attached.
Columns K and L, are not needed and only example for the result I'm looking for.
Tia
Nati
question to Mrexcel.xlsx
ABCDEFGHIJKLMNOPQRSTU
1codeammount Aammount Bmain codeshortened codeammount Aammount Bmain codeammount Aammount B
2300264001363.911186.771264005,772.536,759.8711,951.0021,588.20111,951.0021,588.20
3300264001274.531643.65223106,178.4714,828.33236,452.2756,457.25
4300264001392.93212722310010,226.5727,084.4736,452.2756,457.25327,668.2983,022.93
5300264001741.161802.455014826,225.7029,372.78
6300231001985.076200.573211511,441.7446,513.1927,668.2983,022.93
7300231001844.196664.26957616,226.5536,509.74
8300231001460.551749.7
930023100504.53333.06
10300231001968.786365.24
11300231002463.455771.64
12300021151677.76040.77
13300021151801.776240.66
14300021151750.146300.52
15300021151487.626720.55
16300021151225.14410.36
17300021151750.148400.69
18300021151749.278399.64
19300223101873.194495.66
20300223101680.114032.26
21300223101680.114032.26
2230022310945.062268.15
23300095762598.325846.22
24300095767210.2516223.063
2530009576356.99803.2275
26300095764102.879231.4575
27300095761958.124405.77
28300501488149.7629127.7334
29300501481365.98121529.8989
30300501485082.94845692.9022
31300501482791.18723126.1297
32300501488835.8189896.1162
33
גיליון2
Cell Formulas
RangeFormula
I2:J2I2=B2+B3+B4+B5
K2:L2,K6:L6,K4:L4K2=I2+I3
P2:Q2P2=K2
P3:Q3P3=K4
P4:Q4P4=K6
I3:J3I3=SUM(B19:B22)
I4:J4I4=SUM(B6:B11)
I5:J5I5=SUM(B28:B32)
I6:J6I6=SUM(B12:B18)
I7:J7I7=SUM(B23:B27)
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
Welcome to MrExcel Message Board. Try this:
Book3
ABCDEFGHIJKLMNOPQR
1codeammount Aammount Bmain codeshortened codeammount Aammount Bmain codeammount Aammount B
2300264001363.911186.771264005772.536759.871195121588.211195121588.2
3300264001274.531643.65223106178.4714828.33236452.266856457.25042
4300264001392.93212722310010226.5727084.4736452.266856457.25042327668.2983022.9275
5300264001741.161802.455014826225.696829372.78042
6300231001985.076200.573211511441.7446513.1927668.2983022.9275
7300231001844.196664.26957616226.5536509.7375
8300231001460.551749.7
930023100504.53333.06
10300231001968.786365.24
11300231002463.455771.64
12300021151677.76040.77
13300021151801.776240.66
14300021151750.146300.52
15300021151487.626720.55
16300021151225.14410.36
17300021151750.148400.69
18300021151749.278399.64
19300223101873.194495.66
20300223101680.114032.26
21300223101680.114032.26
2230022310945.062268.15
23300095762598.325846.22
24300095767210.2516223.0625
2530009576356.99803.2275
26300095764102.879231.4575
27300095761958.124405.77
28300501488149.7629127.73344
29300501481365.98121529.898944
30300501485082.94845692.902208
31300501482791.18723126.129664
32300501488835.8189896.11616
33
Sheet1
Cell Formulas
RangeFormula
I2:I7I2=SUMPRODUCT((RIGHT($A$2:$A$32,5)*1=$H2)*($B$2:$B$32))
J2:J7J2=SUMPRODUCT((RIGHT($A$2:$A$32,5)*1=$H2)*($C$2:$C$32))
K6:L6,K4:L4,K2:L2K2=I2+I3
P2:Q2P2=K2
P3:Q3P3=K4
P4:Q4P4=K6
 
Upvote 0

Forum statistics

Threads
1,214,832
Messages
6,121,843
Members
449,051
Latest member
excelquestion515

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