Sum of values based on variable values

PRADEEPSWALSE

New Member
Joined
Nov 27, 2018
Messages
28
Office Version
  1. 2013
Platform
  1. Windows
Hi,
I need help for addition of variable values.
E.g. Values in column 'B' are variable. I want SUM of values mentioned in column 'C' based on values of column 'B'. I have total 10 rows. Values of column 'B' are variable and it will be entered by user. Some cell may be empty. Refer attached Images for easy understanding.

Please suggest solution for this query.
Thanks in advance.

Regards,
Pradeep
 

Attachments

  • Excel Query.JPG
    Excel Query.JPG
    31.6 KB · Views: 12
This will do it. Note that I've added an extra column to the Input table, I don't see that it will be possible to do it without that using your version of excel.

I notice that your sample results are sorted in ascending order by size then thk, if the order is not essential then I could possibly shorten the formulas a bit. (not tried it yet).

There are 2 output tables, one for your version of excel and another using office 365 dynamic arrays so that you can compare the difference. Note with the 365 version, the column that I added to the input table is not needed and most of the formulas are much shorter.
Book1 (version 1)19.2.21.xlsx
ABCDEFGHI
4nosizethkqtyRank
510.75"25575.96
621.5"505150.98
731.5"755150.9866667
840.75"25575.96
951.5"508150.98
1060.75"251075.96
1170.75"100275.99
1283"1002300.99
1391.5"7510150.9866667
14100.75"100675.99
1511 
1612 
1713 
1814 
1915 
20
21
22
23Excel 2007 - 2019Office 365
24nosizethkqtynosizethkqty
2510.75"252010.75"2520
2620.75"100820.75"1008
2731.5"501331.5"5013
2841.5"751541.5"7515
2953"100253"1002
306   
Sheet11
Cell Formulas
RangeFormula
E5:E19E5=IF(OR(B5="",C5=""),"",SUBSTITUTE(B5,"""","")*100+(1-1/C5))
B25:C30B25=IFERROR(INDEX(B$5:B$19,MATCH(SMALL($E$5:$E$19,SUMPRODUCT(COUNTIFS($B$5:$B$19,$B$24:$B24,$C$5:$C$19,$C$24:$C24))+1),$E$5:$E$19,0)),"")
D25:D30D25=IF(C25="","",SUMIFS($D$5:$D$19,$B$5:$B$19,B25,$C$5:$C$19,C25))
F25:F29F25=SEQUENCE(ROWS(G25#))
G25:H29G25=SORT(UNIQUE(FILTER(B5:C19,B5:B19<>"","")))
I25:I29I25=SUMIFS(D5:D19,B5:B19,INDEX(G25#,,1),C5:C19,INDEX(G25#,,2))
Dynamic array formulas.
 
Upvote 0

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.

Forum statistics

Threads
1,214,584
Messages
6,120,387
Members
448,957
Latest member
Hat4Life

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