MurdochQuill
Board Regular
- Joined
- Nov 21, 2020
- Messages
- 84
- Office Version
- 365
- Platform
- Windows
Hi all,
I'm using the below formula to merge columns together, but I'm wondering how I can skip blanks on the input data. The formula I'm using assumes that the ranges are static, however I am also looking to make it a dynamic formula which can handle blank cells, in which case it should skip & then add the next column instead.
Current:
However I'm hoping to achieve this:
Any help would be great.
I'm using the below formula to merge columns together, but I'm wondering how I can skip blanks on the input data. The formula I'm using assumes that the ranges are static, however I am also looking to make it a dynamic formula which can handle blank cells, in which case it should skip & then add the next column instead.
Current:
Book1 | |||||||
---|---|---|---|---|---|---|---|
B | C | D | E | F | |||
1 | List 1 | List 2 | Output | ||||
2 | Jamie | John | Jamie | ||||
3 | Jacob | Julie | Jacob | ||||
4 | Jesus | Jesus | |||||
5 | Jane | Jane | |||||
6 | James | James | |||||
7 | John | ||||||
8 | Julie | ||||||
Sheet1 |
Cell Formulas | ||
---|---|---|
Range | Formula | |
F2 | F2 | =IFERROR(INDEX($B$2:$B$6, ROWS(C1:$C$1)), IFERROR(INDEX($D$2:$D$3, ROWS(C1:$C$1)-ROWS($B$2:$B$6)), "")) |
F3:F8 | F3 | =IFERROR(INDEX($B$2:$B$6, ROWS(C$1:$C2)), IFERROR(INDEX($D$2:$D$3, ROWS(C$1:$C2)-ROWS($B$2:$B$6)), "")) |
However I'm hoping to achieve this:
Book1 | |||||||
---|---|---|---|---|---|---|---|
B | C | D | E | F | |||
1 | List 1 | List 2 | Output | ||||
2 | Jamie | John | Jamie | ||||
3 | Jacob | Julie | Jacob | ||||
4 | James | ||||||
5 | Jesus | ||||||
6 | Jeff | ||||||
7 | Julius | ||||||
8 | James | John | |||||
9 | Jesus | Julie | |||||
10 | Jeff | ||||||
11 | |||||||
12 | Julius | ||||||
Sheet1 |
Cell Formulas | ||
---|---|---|
Range | Formula | |
F2 | F2 | =IFERROR(INDEX($B$2:$B$8, ROWS(C1:$C$1)), IFERROR(INDEX($D$2:$D$3, ROWS(C1:$C$1)-ROWS($B$2:$B$8)), "")) |
F3,F11:F12 | F3 | =IFERROR(INDEX($B$2:$B$8, ROWS(C$1:$C2)), IFERROR(INDEX($D$2:$D$3, ROWS(C$1:$C2)-ROWS($B$2:$B$8)), "")) |
Any help would be great.