Learn the essential functions of CompTIA Security+, which establishes the core knowledge required of any cybersecurity role and leads professionals into intermediate-level cybersecurity jobs.

I have a column of numbers which refer to letters in the adjacent column. There are three similar column pairs, of varying length. How do I make one continuous column pair from all the data? From time to time the lengths of the columns will vary, depending on what is being put into the columns, of course. And I don't want any gaps in the resulting column-pair!

See attached 'sample'.

In fact the columns are on different worksheets, but I don't suppose that matters. All I want to do is put all the data into one continuous column-pair (i.e. the data from the three different column pairs will all string on one below the other). I want the results to go in the yellow shaded boxes. (See attached).

Thanks.

Sample-151130.xlsx

See attached 'sample'.

In fact the columns are on different worksheets, but I don't suppose that matters. All I want to do is put all the data into one continuous column-pair (i.e. the data from the three different column pairs will all string on one below the other). I want the results to go in the yellow shaded boxes. (See attached).

Thanks.

Sample-151130.xlsx

Experts Exchange Solution brought to you by

Enjoy your complimentary solution view.

Get this solution by purchasing an Individual license!
Start your 7-day free trial.

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

pls try

```
Sub macro()
For Each sh In Array("Sheet1", "Sheet2")
If Sheets("Results").Range("M3") = "" Then
Set rngDest = Sheets("Results").Range("M3")
Else
Set rngDest = Sheets("Results").Range("M3").End(xlDown).Offset(1)
End If
Sheets(sh).Range("C3:D" & Range("C3").End(xlDown).Row).Copy Destination:=rngDest
Next
End Sub
```

Regards
Example attached, please click on macro button to see the desired output.

Best,

Sample-151130.xlsb

A few of the numbers are missing in your end result. However, i really wanted a formula (if possible) rather then VBA. Is that possible?

Thanks.

please find attached file with formula solution.

i used Excel tables references because of its dynamic range benefit.

Sample-151130.xlsx

My "real-life" spreadsheet, though, has 24 tables of this sort, each with FOUR columns, and each on a separate worksheet!

Is there a way that I can understand, that will enable your formula to be extended to cope with that?

Thanks.

But to restate my problem:

I have a large number of four-column tables (24 currently, but this will increase over time), one table per worksheet, and I want to put all the data from these tables, automatically, into a continuous four-column table on another, new, worksheet. The data in the tables on the 24+ worksheets gets into those tables from other sources, by means of various formulas. The bringing together of all this data from the 24+ tables needs to be automatic so that if, for example, another row of data appears in any one of the 24 tables, it will be inserted into the continuous table on the new worksheet.

Any ideas, anyone?

look into the attached modified formula. i added one more table making it total 4 tables and one union table

so, i created a new table. first i renamed my union table to table5 and then i created the new table as table4

then i added one additional IFERROR with adding the Index of (Table 4 but this time, see the pattern for previous ones, i added ROW([@Column1])-ROW(Table5

try to compare the previous file and this one. you will learn how to add new table.

please let me know, if you have any question.

Sample-151130.xlsx

Your formula is very good, but I guess what I want will be completely unwieldy if I do it this way!

I attach my entire spreadsheet.

Basically, all the numbered Tables (1-23), which are yellow on the various worksheets that have people's names on them (tabs 4 - 26), need to be added into a composite Table, without the headers, on the final tab (which I've called ".csv file").

If you do that for me, I will be eternally in your debt!

I attach the entire spreadsheet.

I know it's over-complicated, but it's grown itself organically!

Any question, let me know.

Many, many thanks.

Input-hours-from-timesheets--Sylvia.xlsm

i saw your workbook. i tried to understand it. but i could not find any sheet called "csv file"

so, all the yellow tables need to be combined in one table without their headers but this one table where is it located and what is the sheet name or range location for example

i need to know the sheet name and the range where the combined table need to be put for example from column A to Column D.

If you can combine all the yellow tables onto this new spreadsheet in Column A to D, that would be perfect.

Genius.

Thanks.

please see attached.

i created a worksheet named it "MAIN" and then all of the tables are combined with formula on this table. it is dynamic if your data tables on other sheets grow it will automatically populate in this Main sheet table. please note that the empty gaps you have in the main table is because some of your tables were empty and the first row after header had no data.

the formula was long and somehow complicated ;-) but i figured it out. here is the formula

```
=IFERROR(IFERROR(INDEX(Table1, ROW([@Employee])-ROW(Table24[#Headers]),COLUMN(A:A)),IFERROR(INDEX(Table2, ROW([@Employee])-ROW(Table24[#Headers])-ROWS(Table1),COLUMN(A:A)),IFERROR(INDEX(Table3, ROW([@Employee])-ROW(Table24[#Headers])-ROWS(Table1)-ROWS(Table2),COLUMN(A:A)),IFERROR(INDEX(Table4, ROW([@Employee])-ROW(Table24[#Headers])-ROWS(Table1)-ROWS(Table2)-ROWS(Table3),COLUMN(A:A)),IFERROR(INDEX(Table5, ROW([@Employee])-ROW(Table24[#Headers])-ROWS(Table1)-ROWS(Table2)-ROWS(Table3)-ROWS(Table4),COLUMN(A:A)),IFERROR(INDEX(Table6, ROW([@Employee])-ROW(Table24[#Headers])-ROWS(Table1)-ROWS(Table2)-ROWS(Table3)-ROWS(Table4)-ROWS(Table5),COLUMN(A:A)),IFERROR(INDEX(Table7, ROW([@Employee])-ROW(Table24[#Headers])-ROWS(Table1)-ROWS(Table2)-ROWS(Table3)-ROWS(Table4)-ROWS(Table5)-ROWS(Table6),COLUMN(A:A)),IFERROR(INDEX(Table8, ROW([@Employee])-ROW(Table24[#Headers])-ROWS(Table1)-ROWS(Table2)-ROWS(Table3)-ROWS(Table4)-ROWS(Table5)-ROWS(Table6)-ROWS(Table7),COLUMN(A:A)),IFERROR(INDEX(Table9, ROW([@Employee])-ROW(Table24[#Headers])-ROWS(Table1)-ROWS(Table2)-ROWS(Table3)-ROWS(Table4)-ROWS(Table5)-ROWS(Table6)-ROWS(Table8),COLUMN(A:A)),IFERROR(INDEX(Table10, ROW([@Employee])-ROW(Table24[#Headers])-ROWS(Table1)-ROWS(Table2)-ROWS(Table3)-ROWS(Table4)-ROWS(Table5)-ROWS(Table6)-ROWS(Table8)-ROWS(Table9),COLUMN(A:A)),IFERROR(INDEX(Table11, ROW([@Employee])-ROW(Table24[#Headers])-ROWS(Table1)-ROWS(Table2)-ROWS(Table3)-ROWS(Table4)-ROWS(Table5)-ROWS(Table6)-ROWS(Table8)-ROWS(Table9)-ROWS(Table10),COLUMN(A:A)),IFERROR(INDEX(Table12, ROW([@Employee])-ROW(Table24[#Headers])-ROWS(Table1)-ROWS(Table2)-ROWS(Table3)-ROWS(Table4)-ROWS(Table5)-ROWS(Table6)-ROWS(Table8)-ROWS(Table9)-ROWS(Table10)-ROWS(Table11),COLUMN(A:A)),IFERROR(INDEX(Table13, ROW([@Employee])-ROW(Table24[#Headers])-ROWS(Table1)-ROWS(Table2)-ROWS(Table3)-ROWS(Table4)-ROWS(Table5)-ROWS(Table6)-ROWS(Table8)-ROWS(Table9)-ROWS(Table10)-ROWS(Table11)-ROWS(Table12),COLUMN(A:A)),IFERROR(INDEX(Table14, ROW([@Employee])-ROW(Table24[#Headers])-ROWS(Table1)-ROWS(Table2)-ROWS(Table3)-ROWS(Table4)-ROWS(Table5)-ROWS(Table6)-ROWS(Table8)-ROWS(Table9)-ROWS(Table10)-ROWS(Table11)-ROWS(Table12)-ROWS(Table13),COLUMN(A:A)),IFERROR(INDEX(Table15, ROW([@Employee])-ROW(Table24[#Headers])-ROWS(Table1)-ROWS(Table2)-ROWS(Table3)-ROWS(Table4)-ROWS(Table5)-ROWS(Table6)-ROWS(Table8)-ROWS(Table9)-ROWS(Table10)-ROWS(Table11)-ROWS(Table12)-ROWS(Table13)-ROWS(Table14),COLUMN(A:A)),IFERROR(INDEX(Table16, ROW([@Employee])-ROW(Table24[#Headers])-ROWS(Table1)-ROWS(Table2)-ROWS(Table3)-ROWS(Table4)-ROWS(Table5)-ROWS(Table6)-ROWS(Table8)-ROWS(Table9)-ROWS(Table10)-ROWS(Table11)-ROWS(Table12)-ROWS(Table13)-ROWS(Table14)-ROWS(Table15),COLUMN(A:A)),IFERROR(INDEX(Table17, ROW([@Employee])-ROW(Table24[#Headers])-ROWS(Table1)-ROWS(Table2)-ROWS(Table3)-ROWS(Table4)-ROWS(Table5)-ROWS(Table6)-ROWS(Table8)-ROWS(Table9)-ROWS(Table10)-ROWS(Table11)-ROWS(Table12)-ROWS(Table13)-ROWS(Table14)-ROWS(Table15)-ROWS(Table16),COLUMN(A:A)),IFERROR(INDEX(Table18, ROW([@Employee])-ROW(Table24[#Headers])-ROWS(Table1)-ROWS(Table2)-ROWS(Table3)-ROWS(Table4)-ROWS(Table5)-ROWS(Table6)-ROWS(Table8)-ROWS(Table9)-ROWS(Table10)-ROWS(Table11)-ROWS(Table12)-ROWS(Table13)-ROWS(Table14)-ROWS(Table15)-ROWS(Table16)-ROWS(Table17),COLUMN(A:A)),IFERROR(INDEX(Table19, ROW([@Employee])-ROW(Table24[#Headers])-ROWS(Table1)-ROWS(Table2)-ROWS(Table3)-ROWS(Table4)-ROWS(Table5)-ROWS(Table6)-ROWS(Table8)-ROWS(Table9)-ROWS(Table10)-ROWS(Table11)-ROWS(Table12)-ROWS(Table13)-ROWS(Table14)-ROWS(Table15)-ROWS(Table16)-ROWS(Table17)-ROWS(Table18),COLUMN(A:A)),IFERROR(INDEX(Table20, ROW([@Employee])-ROW(Table24[#Headers])-ROWS(Table1)-ROWS(Table2)-ROWS(Table3)-ROWS(Table4)-ROWS(Table5)-ROWS(Table6)-ROWS(Table8)-ROWS(Table9)-ROWS(Table10)-ROWS(Table11)-ROWS(Table12)-ROWS(Table13)-ROWS(Table14)-ROWS(Table15)-ROWS(Table16)-ROWS(Table17)-ROWS(Table18)-ROWS(Table19),COLUMN(A:A)),IFERROR(INDEX(Table21, ROW([@Employee])-ROW(Table24[#Headers])-ROWS(Table1)-ROWS(Table2)-ROWS(Table3)-ROWS(Table4)-ROWS(Table5)-ROWS(Table6)-ROWS(Table8)-ROWS(Table9)-ROWS(Table10)-ROWS(Table11)-ROWS(Table12)-ROWS(Table13)-ROWS(Table14)-ROWS(Table15)-ROWS(Table16)-ROWS(Table17)-ROWS(Table18)-ROWS(Table19)-ROWS(Table20),COLUMN(A:A)),IFERROR(INDEX(Table22, ROW([@Employee])-ROW(Table24[#Headers])-ROWS(Table1)-ROWS(Table2)-ROWS(Table3)-ROWS(Table4)-ROWS(Table5)-ROWS(Table6)-ROWS(Table8)-ROWS(Table9)-ROWS(Table10)-ROWS(Table11)-ROWS(Table12)-ROWS(Table13)-ROWS(Table14)-ROWS(Table15)-ROWS(Table16)-ROWS(Table17)-ROWS(Table18)-ROWS(Table19)-ROWS(Table20)-ROWS(Table21),COLUMN(A:A)),INDEX(Table23, ROW([@Employee])-ROW(Table24[#Headers])-ROWS(Table1)-ROWS(Table2)-ROWS(Table3)-ROWS(Table4)-ROWS(Table5)-ROWS(Table6)-ROWS(Table8)-ROWS(Table9)-ROWS(Table10)-ROWS(Table11)-ROWS(Table12)-ROWS(Table13)-ROWS(Table14)-ROWS(Table15)-ROWS(Table16)-ROWS(Table17)-ROWS(Table18)-ROWS(Table19)-ROWS(Table20)-ROWS(Table21)-ROWS(Table22),COLUMN(A:A)))))))))))))))))))))))),"")
```

EE.xlsm
I have tried it, but there is a problem. The yellow tables are now much shorter, and when (for example) I add more entries in the 'Timesheet Entries' worksheet, for (for example) A Jerrum, if you look on the 'A Jerrum' worksheet, there are only rows in the yellow table, and if I keep adding more entries (beyond 2) for A Jerrum, they don't appear in the MAIN worksheet table. I need the yellow tables to be as long as they originally were (about 200 rows of the 4-column yellow table). The same for each of the 24 yellow tables!

Any thoughts?

Thanks.

the problem is caused with your formulas in the yellow tables.

it has nothing to do with the MAIN sheet table formula.

for example , please open the attached file. i added more data in the Jerrum' worksheet and i put Professor in all cells and all of them appears in the Main Sheet table automatically.

you need to get your yellow sheets formulas fixed. becuase the MAIN sheet table formula is robust and i tested it and have no problem at all.

EE.xlsm

I think I may have confused you, or not mentioned one thing: my entry point for data - my ONLY entry point - is on the 'Timesheet entries' worksheet. Everything goes on there, and it gets transmitted by my formulas to the yellow tables in the various worksheets with the peoples' names on (e.g. A Jerrum, A Short, etc.).

So all I want to do is get the data in the yellow tables, the data that has got to those tables automatically via the formulas, all starting from the 'Timesheet Entries' worksheet - I want to get the yellow table entries onto your MAIN worksheet. But I cannot and certainly must not, put anything straight into the yellow tables. In fact, in the end i want all my other worksheets except the 'Timesheet Entries' and 'MAIN' worksheets hidden from the data entry clerk so that she just enters her data onto the 'Timesheet Entries' worksheet, and then the resulting long table that your brilliant formula has produced can be exported to our accounts software.

Hope that makes sense. Also, i don't really want any gaps in the table rows on your MAIN worksheet.

Am I asking too much? Your help has been absolutely invaluable, and I will try to learn from your huge formula, but it's mind-boggling!

Thanks very much for your continuing help.

Input-hours-from-timesheets--Sylvia.xlsm

Phew! it was a complicated work. this was the longest formula, i ever written.

well, i had to work again in your original file. now i understood that your yellow cell tables have to have their empty cells.

i reworked the formula with some other tricks and now it is working. i did not touch your other 23 yellow tables they are all intact. please find attached workbook. when any new data pops into the yellow tables. it will automatically pop into the Main Sheet Table24

plz let me know how it goes. hopefully this is the final wrap up

EE.xlsb

Amazing work! What a formula!

One thing, though. I attach the spreadsheet again, with every person put in, to see what it does - but there are two things:-

(1) The 'Lee Brown' entry does not show up on your 'MAIN' worksheet when i enter it on the 'Timesheet entries' worksheet, and (2) the spreadsheet now works very slowly. That maybe doesn't matter too much - and I guess it might be because your formula is HUGE - but is it also because it's now in .xlsb format?

But thanks for your amazing formula!!!

Lat me know what you think.

Thanks again!

EE-test---151219.xlsb

you are most welcome. i always like to answer challenging questions and go beyond the expectation.

anyone could answer simple questions like vlookup ;-)

thanks for spotting the 'Lee Brown' glitch. i fixed the formula it was missing addtional parathesis. so it is fixed in the attached version.

the slowness is of calculation is due to the formula being in hundreds of rows, so i am affraid you have to live with it :-)

here is the final formula that resides in cells B3 to E4696

=IFERROR(IFERROR(INDEX(Tab