How to make textjoin with sum qty?

Sochen

Board Regular
Joined
Dec 6, 2022
Messages
63
Office Version
  1. 2021
Platform
  1. Windows
Hi everyone,

Could you please help me if find if there is any formula that can combine between "Location of Code" and "Qty" as below.
The result I want is "Summary Location with Qty" in Orange Column.

Thank you!

Test 3.xlsx
ABCD
1LocationCodeQty
2A1A0011
3B1A0012
4A3B0012
5B1B0011
6A3B0012
7A1B0025
8A3B0022
9A2C0021
10B1C0022
11A3C0033
12B1C0031
13B1D0013
14A3D0012
15
16CodeQtySummary LocationSummary Location with Qty
17A0013A1, B1A1 = 1, B1 = 2
18B0015A3, B1A3 = 4, B1 = 1
19B0027A1, A3A1 = 5, A3 = 2
20C0023A2, B1A2 = 1, B1 = 2
21C0034A3, B1A3 = 3, B1 = 1
22D0015B1, A3B1 = 3, A3 = 2
Example 2
Cell Formulas
RangeFormula
A17:A22A17=UNIQUE(B2:B14)
B17:B22B17=SUMIF($B$2:$B$14,A17,$C$2:$C$14)
C17:C22C17=UNIQUE(TEXTJOIN(", ",TRUE,UNIQUE(FILTER($A$2:$A$14,$B$2:$B$14=$A17,""))))
Dynamic array formulas.
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
How about
Excel Formula:
=LET(u,UNIQUE(FILTER($A$2:$A$14,$B$2:$B$14=$A17,"")),TEXTJOIN({" = ",", "},TRUE,CHOOSE({1,2},u,SUMIFS($C$2:$C$14,$A$2:$A$14,u,$B$2:$B$14,A17))))
 
Upvote 0
Solution
Fluff: you should publish a tutorial on using LET. Always really creative and interesting!!
 
Upvote 0
How about
Excel Formula:
=LET(u,UNIQUE(FILTER($A$2:$A$14,$B$2:$B$14=$A17,"")),TEXTJOIN({" = ",", "},TRUE,CHOOSE({1,2},u,SUMIFS($C$2:$C$14,$A$2:$A$14,u,$B$2:$B$14,A17))))
It works perfectly. Thank you so much!
What if we use only excel 2019 which this LET function is not available. So may I ask if there is any formula can be used for excel 2019 to solve this problem?
 
Upvote 0
2019 doesn't have the Unique function, so you must be using something newer.
 
Upvote 0
You're welcome & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,215,641
Messages
6,125,982
Members
449,276
Latest member
surendra75

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