Fine tuning of single cell formula

sharshra

Active Member
Joined
Mar 20, 2013
Messages
352
Office Version
  1. 365
I´m using single cell formula to get the summary table. I´m making some mistake & not getting the desired output. Can the experts in this forum help please?

Problems (compare the desired output table & output from single cell formula) :
1. I want to get the ids for each person split between modules. Now I´m getting the combined ids for each person in the output table.
2. I want to get the count of ids for each output row. I tried few options but failed.
3. Module & person distribution is not happening correctly. It should be as shown in the desired output table.

Output table (Single cell formula):
excel problems.xlsx
MNOP
2modulepersoncount of idid
3coa1, 2, 3, 4, 5, 8
4clb3, 6, 9, 10
5clc3, 6
6cld4, 7
Sheet3
Cell Formulas
RangeFormula
M3:O6M3=LET( id,B3:B17, p,D3:D17, m,C3:C17, uP,UNIQUE(FILTER(p,p<>"")), mName,XLOOKUP(uP,p,m), pId, MAP(uP,LAMBDA(x,TEXTJOIN(", ",,UNIQUE(FILTER(id,p=x))))), HSTACK(mName,uP,pId))
Dynamic array formulas.


Source table:
excel problems.xlsx
BCD
2idmoduleperson
31coa
42coa
53clb
63clc
73cla
84cla
94cld
105coa
116cob
126coc
136coc
147cld
158cla
169clb
1710cob
Sheet3


Desired output:
excel problems.xlsx
FGHIJ
2modulepersoncount of ididRemarks
3cla33, 4, 8
4coa31, 2, 5
5clb23, 9
6cob26, 10
7clc13
8coc16duplicate removed
9clc24, 7
Sheet3
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
Hello, would this address it?

Excel Formula:
=LET(
id,A2:A16,
module,B2:B16,
person,C2:C16,
mp,B2:C16,
a,SORT(UNIQUE(mp),{2,1}),
b,MAP(CHOOSECOLS(a,1),CHOOSECOLS(a,2),LAMBDA(a,b,ROWS(UNIQUE(FILTER(id,(module&person=a&b)))))),
c,DROP(REDUCE("",CHOOSECOLS(a,1)&CHOOSECOLS(a,2),LAMBDA(a,b,VSTACK(a,TEXTJOIN(", ",,SORT(UNIQUE(FILTER(id,(module&person=b)))))))),1),
HSTACK(a,b,c))
 
Upvote 0
Another option
Fluff.xlsm
ABCDEFGHI
1
2idmodulepersonmodulepersoncount of idid
31coacla33, 4, 8
42coacoa31, 2, 5
53clbclb23, 9
63clccob26, 10
73claclc13
84clacoc26
94cldcld24, 7
105coa
116cob
126coc
136coc
147cld
158cla
169clb
1710cob
Data
Cell Formulas
RangeFormula
F3:I9F3=LET(f,FILTER(B3:D100,B3:B100<>""),u,SORT(UNIQUE(DROP(f,,1)),{2,1}),HSTACK(u,COUNTIFS(C:C,INDEX(u,,1),D:D,INDEX(u,,2)),BYROW(u,LAMBDA(br,TEXTJOIN(", ",,UNIQUE(FILTER(B3:B100,(C3:C100=INDEX(br,,1))*(D3:D100=INDEX(br,,2)))))))))
Dynamic array formulas.
 
Upvote 1
Solution
One more option:
Book9.xlsx
ABCDEFGHIJ
1
2idmoduleperson
31coacla33, 4, 8
42coacoa31, 2, 5
53clbclb23, 9
63clccob26, 10
73claclc13
84clacoc16Duplicates removed
94cldcld24, 7
105coa
116cob
126coc
136coc
147cld
158cla
169clb
1710cob
Sheet4
Cell Formulas
RangeFormula
F3:J9F3=LET(d,B3:D17, id,CHOOSECOLS(d,1), module,CHOOSECOLS(d,2), person,CHOOSECOLS(d,3), uModulePerson,UNIQUE(CHOOSECOLS(d,2,3)), ids,BYROW(uModulePerson,LAMBDA(x, TEXTJOIN(", ",,FILTER(id,(module=CHOOSECOLS(x,1))*(person=CHOOSECOLS(x,2)))))), uids,BYROW(uModulePerson,LAMBDA(x, TEXTJOIN(", ",,UNIQUE(FILTER(id,(module=CHOOSECOLS(x,1))*(person=CHOOSECOLS(x,2))))))), nids,BYROW(uModulePerson,LAMBDA(x, COUNTA(UNIQUE(FILTER(id,(module=CHOOSECOLS(x,1))*(person=CHOOSECOLS(x,2))))))), SORT(SORT(HSTACK(uModulePerson,nids,uids,IF(uids=ids,"","Duplicates removed")), 1),2) )
Dynamic array formulas.
 
Upvote 1
Glad we could help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,221,310
Messages
6,159,176
Members
451,543
Latest member
cesymcox

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