Appending one list to another to combine data sources - excel

So I have several tables on different sheets
Sheet 1
A...B
Allan...345
Angela...500
Sheet 2
A...B
Brian...600
Brenda...250
Sheet 3
A...B
Colin...190
Cathy...370
I would like the data on all three sheets to be appended to each other on sheet 4 as follows:
A...B
Allan...345
Angela...500
Brian...600
Brenda...250
Colin...190
Cathy...370
Ideally any changes made to sheets 1-3 or additional rows inserted into those tables are inserted automatically on sheet 4 so that the combined list is always up to date.

After defining a name for each column of data on each sheet A through C, as per this convention, I was able to produce the desired output using
=IFERROR(INDEX(ListX,ROWS(A1:$A$1)),IFERROR(INDEX(ListY,ROWS(A1:$A$1)-ROWS(ListX)),IFERROR(INDEX(ListZ,ROWS(A1:$A$1)-ROWS(ListX)-ROWS(ListY))"")))
using SHIFT+CTRL+ENTER to create the formula as an array function and by copying down I was able to automatically list the entire contents of both columns separately.
Additional information about defined name is here, which was new to me.

Related

Copy cell to another sheet if condition is met

I have a sheet with a large data array, which I would like to split into several sheets based on values in a column.
In the main sheet, column "A", I have various labels. On the new sheet, e.g. "LabelX" i need to extract all rows from main sheet, corresponding to "LabelX" value in column "A". There are multiple rows with same label.
Hope it makes sense,
Basic example
It looks as if you want to have your data sorted.
If your columns in your data and in your result are in the same order and you use Office365 this can be done using:
=SORT(FILTER(MainSheet!A:D,A:A<>""))
(Replace MainSheet! with the actual sheet name of your main sheet).
or if you want the results for one particular Label only (for example: Label1) you can loose SORT:
=FILTER(MainSheet!A:D,A:A="Label1").

Compare users in different sheets and add user to sheet A if not present in A but present in B

We use an Excel file as a support tracker. Our main sheet (A) has a list of users and their data. For daily support, we run the MYSQL stored procedure to get the data, then paste it into a blank sheet (B) that colors and filters the data.
I am supposed to search the users in sheets A and B, and if a user is present in B but not A (scenario representing adding a user to our system) add the missing user to sheet A.
Based on my past programming knowledge, the steps should be:
count rows in sheets A and B
A has more data further down the sheet that is not raw user data, but it is in the same columns so looking for the first blank cell in A
do a compare on those results
if the results are different, do a vlookup to find the missing entry
insert that entire row from sheet B to sheet A
I assume this can be done with VBA code.
You can write a VBA script to do this, and probably should if this is a regular process.
Alternatively a sorting approach will handle this and many similar problems. It works like this, given two sheets A & B with mixed duplicate and unique entries:
Append B to A
Sort by desired category (User in this case)
This will have duplicates (User) next to each other
Insert a match check column consisting of If User EQ PreviousUser, True, False;
Cut and paste Values to change from a function to simple content of True/False
Sort by True/False column
Delete the entire block of True's
Done!
This approach also works for more than two sheets. Append them all together, sort, mark dups, delete.

How to merge/copy a single column's values in one sheet into another sheet based on the values of a column using excel?

I have two excel spreadsheets (that I can put onto two separate sheets within one sheet, one call A, and one called B).
Spreadsheet A/Or Sheet A
NAME,SPORT
Jordan,Tennis
Jordan,Basketball
Jess,Tennis
Mike,Baseball
Spreadsheet B/Or Sheet B
NAME,AGE
Jorden,5
Jess, 6
Mike, 10
I want to make it so that I can merge the two spreadsheets such that the "Age" column is added to Sheet A with the resulting spreadsheet:
NAME,SPORT,AGE
Jordan,Tennis,5
Jordan,Basketball,5
Jess,Tennis,6
Mike,Baseball,10
How can I do this?
Assume there is an exact match for names in Spreadsheet B to Spreadsheet A (first names only, no need to worry about last names).
Range of values could be variable, but if it's just a matter of making sure the range is updated as new values are put in manually, it's okay. Unless there is a smarter way.
In sheet A, cell C2 :
=INDEX('Sheet B'!$B$2:$B$4,MATCH('Sheet A'!A2,'Sheet B'!$A$2:$A$4,0))
Things to consider :
Is the size of your data variable ? > Do you need to adapt the look up range ?
Will you have duplicates in the names ? > What if two different kids are called "Jordan"

Unique Values in Drop Down List

I have two workbooks, a source file and an output file.
The source file contains information which occupies some drop-down lists in the output file.
For each drop-down list I have two 'names' (in the name manager) linked to it. For instance, the name 'SchemeID' in my output file refers to the same name in my source file. It consists of several rows/columns of data, and that populates my drop-down list.
There are some repeats in the source file (e.g. different names associated with the same number) which are appearing in the drop down lists, and I'd like to get rid of them so the list only displays unique values. Is it possible to do this using data from different workbooks?
The easiest way is oging to be to go to the source workbooks, Data Ribbon -> Remove Duplicates. Anything else will require a couple of in-between data sheets or VBA to do cleanly. If your data doesn't change option this manual method should be fine.
EDIT as you seem restricted from editing the Source File
In a different sheet (let's say Sheet2) you will need a formula which pulls in all of your data from your 2 source Names. To my knowledge there is no clean non-VBA way to combine to Named Ranges, so we will need to do this by dumping the data down to a sheet, and then picking it up again.
There are a lot of ways to do this, but I'm going to pick the one broken down to the most steps; it will be a pretty messy sheet, but you can hide it if you need to, which shouldn't be a huge concern as a non-VBA method will need a data dump sheet anyway.
In Cell D1, we will put the number of rows in SchemeID, as follows:
=ROWS(SchemeID)
In Cell D2, we will put the number of rows in SchemeID2 (which I assume is the name for your second list, which you didn't specify):
=ROWS(SchemeID2)
In column B we will be dumping in the data from both named lists, without sorting or eliminating duplicates. Do this as follows, starting at A1 and dragged down (if you want headers this gets a little trickier, so I will assume no headers).
=IF(ROW()<=$D$1,INDEX(SchemeID,ROW()),INDEX(SchemeID2,ROW()-$D$1)
This says - if the row is not more than the total entries in SchemeID, then pull the value from SchemeID at the current row #. Otherwise, pull the entry from SchemeID2, at the current row# less the total rows in SchemeID (so if we are at row 10, but SchemeID ends at row 4, then row 10 will pull the 6th entry from SchemeID2).
Now in Column A, we will be checking to see which row is a duplicate, as follows starting at A2 [A1 is hardcoded as 1]:
=IF(ISERROR(MATCH(B2,$B$1:B1,0)),A1+1,A1)
This checks to see if there's a duplicate of the current value in column B, in the rows above the current row. If there is, it keeps the same index # as the row above (which will be ignored when we use this as the index key next). If there's no duplicate, it adds 1 to the index number.
In cell D3, put the following formula to track how many unique IDs there are:
=MAX(A:A)
Next, in column C, put your new list, which pulls from column B for as many unique values as there are [drag down]:
=VLOOKUP(ROW(),A:B,0)
This is your new non-duplicate list. To make a clean reference to it, create a new named range with the following formula:
=INDIRECT("'Sheet2!R1C3:R"&'Sheet2!$D$3&"C3", FALSE)
This will simplify to [Assuming 20 rows of data in column C, bsaed on what D3 says]:
='Sheet2!R1C3:R20C3'
Which, in the R1C1 method of referencing, means Sheet2!C1:C20.
This new named range should be what your dropdown lists refer to on your other tab.

Combining data from 3 separate Spreadsheets in Excel

I'm trying to combine data from 3 separate spreadsheets:
-All three sheets have a common column called "Tag" which has ID numbers
-Sheet 1 contains the most info and will be used as the sheet where everything will be merged into.
-Sheet 2 has certain dates which i would like to move to sheet 1 but i want the info matched up with the correct ID numbers and hence end up in the same row in sheet 1 as the data in sheet 1 with the same ID number
-Sheet 3 also has certain info i would like to move to sheet 1 and i also want the info presented the same way as the info from sheet 2.
How should I go about doing this? I'm not as good with vlookup and pivot tables and im unsure what can help me best and how to do it.
thanks in advance for your help.
Here is an example of Vlookup:
You can simply use this formula to populate all the other data for each tag on your master worksheet.
Autofill is a way of populating formulas and values into other cells - by dragging your initial formula into those other cells. You should read about it as it is an essential part of nearly any use of excel.
http://www.homeandlearn.co.uk/excel2007/excel2007s2p2.html

Resources