#28 — Combine Two Tables With Different Column Headers

Problem description & analysis:

Here are two Excel “named ranges”, which are Events1 and Events2 respectively. Starting from the 2nd row, both can be regarded as a table with column headers and some of their headers are the same.

Task: Referenc…


This content originally appeared on DEV Community and was authored by Judith-Excel-Sharing

Problem description & analysis:

Here are two Excel "named ranges", which are Events1 and Events2 respectively. Starting from the 2nd row, both can be regarded as a table with column headers and some of their headers are the same.

original table 1
original table 2
Task: Reference names of the two "named ranges" and combine the two tables; display a field that does not exist under the current range name as empty.

desired table

Solution:

Use SPL XLL to do this:

=spl("=?1.to(3,).($[Events1]|~.m(1,2,3,0,4))|?2.to(3,).($[Events2]|~.m(1,0,0,2,3))",Events1,Events2)

As shown in the picture below:

result table with code entered
Explanation:

to(3,) function gets members from the 3rd to the last. m()function gets multiple members according to their positions; 0 means null. ~ is the current member, and $[] represents a string.


This content originally appeared on DEV Community and was authored by Judith-Excel-Sharing


Print Share Comment Cite Upload Translate Updates
APA

Judith-Excel-Sharing | Sciencx (2024-07-18T03:19:00+00:00) #28 — Combine Two Tables With Different Column Headers. Retrieved from https://www.scien.cx/2024/07/18/28-combine-two-tables-with-different-column-headers/

MLA
" » #28 — Combine Two Tables With Different Column Headers." Judith-Excel-Sharing | Sciencx - Thursday July 18, 2024, https://www.scien.cx/2024/07/18/28-combine-two-tables-with-different-column-headers/
HARVARD
Judith-Excel-Sharing | Sciencx Thursday July 18, 2024 » #28 — Combine Two Tables With Different Column Headers., viewed ,<https://www.scien.cx/2024/07/18/28-combine-two-tables-with-different-column-headers/>
VANCOUVER
Judith-Excel-Sharing | Sciencx - » #28 — Combine Two Tables With Different Column Headers. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2024/07/18/28-combine-two-tables-with-different-column-headers/
CHICAGO
" » #28 — Combine Two Tables With Different Column Headers." Judith-Excel-Sharing | Sciencx - Accessed . https://www.scien.cx/2024/07/18/28-combine-two-tables-with-different-column-headers/
IEEE
" » #28 — Combine Two Tables With Different Column Headers." Judith-Excel-Sharing | Sciencx [Online]. Available: https://www.scien.cx/2024/07/18/28-combine-two-tables-with-different-column-headers/. [Accessed: ]
rf:citation
» #28 — Combine Two Tables With Different Column Headers | Judith-Excel-Sharing | Sciencx | https://www.scien.cx/2024/07/18/28-combine-two-tables-with-different-column-headers/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.