zoharb
Board Regular
- Joined
- Nov 24, 2011
- Messages
- 85
- Office Version
- 2021
- 2013
Sub multijoiner()
Dim rng As Range
Dim A As String
Dim B As Integer, I As Integer, C As Integer
Set rng = Range("A1:G7") ' Adjust as required
A = ""
B = ActiveCell.Offset(-1, 0).Value
C = Application.WorksheetFunction.CountIfs(rng, B)
If C = 0 Then
ActiveCell = "Not found"
Set rng = Nothing
Exit Sub
Else
End If
For Each Cell In rng
If Cell.Value = B Then
A = A & Cells(Cell.Row(), 1).Value & " " & Cells(1, Cell.Column()).Value
Else
End If
Next
ActiveCell = A
Set rng = Nothing
End Sub
25 04 01.xlsm | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | I | J | K | |||
1 | 2014 | 2015 | 2016 | 2017 | 2018 | 2019 | 35 | jan 2019 | jan 2019 | ||||
2 | aug | 5 | 7 | 9 | 11 | 13 | 15 | 31 | dec 2019, jan 2017 | dec 2019, jan 2017 | |||
3 | sep | 9 | 10 | 12 | 15 | 17 | 19 | ||||||
4 | oct | 13 | 13 | 15 | 19 | 21 | 23 | ||||||
5 | nov | 17 | 16 | 18 | 23 | 25 | 27 | ||||||
6 | dec | 21 | 19 | 21 | 27 | 29 | 31 | ||||||
7 | jan | 25 | 27 | 29 | 31 | 33 | 35 | ||||||
zoharb |
Cell Formulas | ||
---|---|---|
Range | Formula | |
K1:K2 | K1 | =MAP(I1:I2,LAMBDA(r,TEXTJOIN(", ",1,IF(B2:G7=r,A2:A7&" "&B1:G1,"")))) |
J1:J2 | J1 | =TEXTJOIN(", ",1,IF(B$2:G$7=I1,A$2:A$7&" "&B$1:G$1,"")) |
Dynamic array formulas. |
1apr25-invoice-all clients-Sep23.xlsm | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | I | J | K | L | |||
1 | 2014 | 2015 | 2016 | 2017 | 2018 | 2019 | ||||||||
2 | aug | 5 | 7 | 9 | 11 | 13 | 15 | 27 | nov 2019dec 2017jan 2015 | |||||
3 | sep | 9 | 10 | 12 | 15 | 17 | 19 | 27 | nov 2019, dec 2017, jan 2015 | |||||
4 | oct | 13 | 13 | 15 | 19 | 21 | 23 | output @now | ||||||
5 | nov | 17 | 16 | 18 | 23 | 25 | 27 | 27 | Nov-19 | output needed | ||||
6 | dec | 21 | 19 | 21 | 27 | 29 | 31 | Dec-17 | ||||||
7 | jan | 25 | 27 | 29 | 31 | 33 | 35 | Jan-15 | ||||||
Sheet2 |
Cell Formulas | ||
---|---|---|
Range | Formula | |
I2 | I2 | =CONCAT((IF(H2=B2:G7,A2:A7&" "&B1:G1,""))) |
I3 | I3 | =TEXTJOIN(", ",1,IF(B$2:G$7=H3,A$2:A$7&" "&B$1:G$1,"")) |
Good idea to tell/show us that at the start?I need output of each data in a different row.
25 04 01.xlsm | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | I | |||
1 | 2014 | 2015 | 2016 | 2017 | 2018 | 2019 | |||||
2 | aug | 5 | 7 | 9 | 11 | 13 | 15 | ||||
3 | sep | 9 | 10 | 12 | 15 | 17 | 19 | ||||
4 | oct | 13 | 13 | 15 | 19 | 21 | 23 | ||||
5 | nov | 17 | 16 | 18 | 23 | 25 | 27 | 27 | Nov-19 | ||
6 | dec | 21 | 19 | 21 | 27 | 29 | 31 | Dec-17 | |||
7 | jan | 25 | 27 | 29 | 31 | 33 | 35 | Jan-15 | |||
zoharb (2) |
Cell Formulas | ||
---|---|---|
Range | Formula | |
I5:I7 | I5 | =FILTERXML("<p><c>"&TEXTJOIN("</c><c>",1,IF(B2:G7=H5,A2:A7&"-"&B1:G1,""))&"</c></p>","//c") |
Dynamic array formulas. |
MrExcel_2025-03.xlsm | |||||||||
---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | |||
1 | 2014 | 2015 | 2016 | 2017 | 2018 | 2019 | |||
2 | aug | 5 | 7 | 9 | 11 | 13 | 15 | ||
3 | sep | 9 | 10 | 12 | 15 | 17 | 19 | ||
4 | oct | 13 | 13 | 15 | 19 | 21 | 23 | ||
5 | nov | 17 | 16 | 18 | 23 | 25 | 27 | ||
6 | dec | 21 | 19 | 21 | 27 | 29 | 31 | ||
7 | jan | 25 | 27 | 29 | 31 | 33 | 35 | ||
8 | 35 | 31 | |||||||
9 | #VALUE! | ||||||||
013 |
Cell Formulas | ||
---|---|---|
Range | Formula | |
C9 | C9 | =FILTER(B2:G7,B2:G7=C8,"") |
It looks like you are trying to treat the 6 x 6 array of cells as if it were a 1 column x 36 rows array. Filtering the array B2:G7 would always return an array containing 6 columns.Why is this throwing the #VALUE! error?