Hi @MikeVol - it works.Thank you so muchHi @Nandakumar. Try this array formula (after entering, press Ctrl+Shift+Enter, not just Enter) if you have Excel 365/2021 (or Excel with FILTER/TEXTJOIN support): C7 =TEXTJOIN(", ", TRUE, FILTER(C$11:M$11, INDEX(C12:M22, MATCH(C3, B12:B22, 0), 0) = C5))
Or if you have an old version of Excel (without FILTER, TEXTJOIN). You can use an array formula (after entering, press Ctrl+Shift+Enter, not just Enter): C7 =INDEX(C$11:M$11, MATCH(TRUE, INDEX((INDEX(C12:M22, MATCH(C3, B12:B22, 0), 0)=C5), 0), 0))
These formulas will work for the example file you provided. I hope these formulas will solve your problem. Good luck.
Thank you so muchAn alternative is to create parameter queries in Power Query. See attached. Fill in the parameters and then on the data tab, select Data, RefreshAll
Hi @MikeVol - I need help on the formula.If i want to change the scenario if name repeats.Attached excel sheet for referenceHi @Nandakumar. Try this array formula (after entering, press Ctrl+Shift+Enter, not just Enter) if you have Excel 365/2021 (or Excel with FILTER/TEXTJOIN support): C7 =TEXTJOIN(", ", TRUE, FILTER(C$11:M$11, INDEX(C12:M22, MATCH(C3, B12:B22, 0), 0) = C5))
Or if you have an old version of Excel (without FILTER, TEXTJOIN). You can use an array formula (after entering, press Ctrl+Shift+Enter, not just Enter): C7 =INDEX(C$11:M$11, MATCH(TRUE, INDEX((INDEX(C12:M22, MATCH(C3, B12:B22, 0), 0)=C5), 0), 0))
These formulas will work for the example file you provided. I hope these formulas will solve your problem. Good luck.
,Code:=TOROW(FILTER(IF(C13:K23=C5,C12:K12,NA()),B13:B23=C3),3)
View attachment 90345
In the case where the same name visits the same city in the same month more than once you may want to wrap the result in UNIQUE:
Code:=UNIQUE(TOROW(FILTER(IF(C13:K23=C5,C12:K12,NA()),B13:B23=C3),3),TRUE)
If there are more columns it will show them.Hi
Thanks for the formula.
How to extend the formula for the third column and nth column?
Hi
Thanks got it.There is no Delhi in Sept for A123
Take the ,TRUE out that I highlighted with a red oblong in my msg#11, and if you want to see repeating months then take out the UNIQUE wrapper too.I tweaked the data,but answer is coming in ascending based on month instead on actual basis.Attached excel sheet with expected answer.
Why?!Hi - how to change the formula to specific cells instead of dynamic arrays.
For example i want to put the formula for D7,E7,F7 instead of automatically taking the formulas to other columns?
Attached excel sheet for your reference
Thanks you so muchWhy?!
=INDEX(TOROW(FILTER(IF($C$13:$K$23=C5,$C$12:$K$12,NA()),$B$13:$B$23=C3),3),1)
will give you the first result.
=INDEX(TOROW(FILTER(IF($C$13:$K$23=C5,$C$12:$K$12,NA()),$B$13:$B$23=C3),3),2)
will give you the second result etc.