jbesclapez
Active Member
- Joined
- Feb 6, 2010
- Messages
- 275
Hello,
I made a stupid formula. It works but as my data increases it gets impossible. I need a better version of it. No VBA plz.
Basically the formula concatenates N amount of cells that are below each other.
The N amount to concatenate is on another cell in the same line.
You can have many groups of N.
The X amount helps you differenciate the groups as a new group always starts with 1...to N
In the example below, the tricky one is the group N=5 because there are 2 groups : The first one giving the result KLMNO and the second one PQRST
<tbody>
</tbody>
How can I solve that easily knowing that N can be above 60
Thanks
<tbody>
</tbody>
I made a stupid formula. It works but as my data increases it gets impossible. I need a better version of it. No VBA plz.
Code:
=IF(H20=1,I20,IF(H20=2,IF(J20=1,I20&"--"&I21,K19),IF(H20=3,IF(J20=1,I20&"--"&I21&"--"&I22,K19),IF(H20=4,IF(J20=1,I20&"--"&I21&"--"&I22&"--"&I23,K19),IF(H20=5,IF(J20=1,I20&"--"&I21&"--"&I22&"--"&I23&"--"&I24,K19),IF(H20=6,IF(J20=1,I20&"--"&I21&"--"&I22&"--"&I23&"--"&I24&"--"&I25,K19),IF(H20=7,IF(J20=1,I20&"--"&I21&"--"&I22&"--"&I23&"--"&I24&"--"&I25&"--"&I26,K19),"Superieura7")
))))))
Basically the formula concatenates N amount of cells that are below each other.
The N amount to concatenate is on another cell in the same line.
You can have many groups of N.
The X amount helps you differenciate the groups as a new group always starts with 1...to N
In the example below, the tricky one is the group N=5 because there are 2 groups : The first one giving the result KLMNO and the second one PQRST
N | X | data | Expected Result |
1 | 1 | A | A |
1 | 1 | B | B |
2 | 1 | C | CD |
2 | 2 | D | CD |
3 | 1 | E | EFH |
3 | 2 | F | EFH |
3 | 3 | H | EFH |
1 | 1 | I | I |
1 | 1 | J | J |
5 | 1 | K | KLMNO |
5 | 2 | L | KLMNO |
5 | 3 | M | KLMNO |
5 | 4 | N | KLMNO |
5 | 5 | O | KLMNO |
5 | 1 | P | PQRST |
5 | 2 | Q | PQRST |
5 | 3 | R | PQRST |
5 | 4 | S | PQRST |
5 | 5 | T | PQRST |
<tbody>
</tbody>
How can I solve that easily knowing that N can be above 60
Thanks
PQRST |
<tbody>
</tbody>