Using Excel transpose data from column to row whilst also finding uniques - excel

I have what seems to be an easy task but at the minute i'm stumped.
I have a list of text values, say A1:A19, with multiple entries some of which are repeated in the list.
I want to take the list in column A and copy to a row, say B2:B8, However i only want to move across each individual value once. Can this be done?

UNIQUE returns the unique values from a range.
TRANSPOSE rotates cells from rows to columns or vice-versa.
=TRANSPOSE(UNIQUE(A2:A19))

Related

How to delete duplicates within a large database on a column by column basis

I have a large set of data (over 3000 columns) for work, with text in every cell. Each column is unrelated to each other. Within each column there are potentially duplicates and I need to keep only the first instance , but there is no way to highlight the cells with duplicates on a column by column basis as when the whole data set is highlighted excel treats the rows as related data and looks for duplicates on a row by row basis. I have tried using macros (I am a total novice) but the macros don't work.
Image shows the columns of data with some duplicates in the columns.
If you use the modern Excel, you could use the UNIQUE function, which returns the array of unique elements.
Just duplicate the sheet and in the copy delete everything below the lines with "Processor 1" and "Processor 2". Then in the first column use UNIQUE referring to the first respective column of the original sheet.
Just fill the formula right (Ctrl + R) and in the new sheet each column will have only the unique elements.
You can then paste the whole resulting table as values and delete the original one.

Excel copy function with rotation

I have a spreadsheet with two portions, the first's rows are usernames and columns are data types (availability, ID, email etc), the second's rows are the data types and columns are the usernames. The second's values must be calculated based on what is in corresponding cells in the first. The second isn't simply copied from the first, each cell contains calculation based on multiple columns of the first portion.
I have been asked to keep these as they are currently, as in don't just create new new columns in the first portion or rotate the second.
So my question is: is there a way that I can copy a function across columns in a way that the variable changing by column is the row number not the column number?
I know the thing I'm trying to do makes no sense. Makes no sense to me neither, but this is what I've been asked to do.
Ended up using a whole bunch of INDIRECT(ADDRESS(MATCH, MATCH)) functions to get the values then get the desired values from them into the second portion.
A second table or extra column would've been so much cleaner but hey, to each their own.

Finding Duplicates across a thousand lists

I have over 1,100 lists that each contain no more than 30 items in them. I am trying to see if there are any items within the lists that appear in all lists. I was initially thinking that I would need to compare the list in column A to the list in column B, store the duplicates, then compare the duplicates to the list in Column C, store the new duplicates, compare the new duplicates to the list in Column D, and so on until all the lists have been covered.
My questions are:
1.) Is this the correct way to approach this?
2.) If so, is there a simple VBA code that could be used to do this?
Deduplicate each list using Data > Remove Duplicates
Collate all the lists into one long list
Create a pivot table with the column of items as the Row dimension
Use the same column as the Value displayed in the pivot table, and aggregate using Count.
Sort the pivot table in descending order of that count.
The count shows the number of lists in which each item appears. If any have a count of 1100 then they must occur in every list.
Here's my non VBA solution to this fun problem. The plan is to search each item in any one list and compare to all the other lists in the table.
Start off by inserting a new "A" column to the left of your table. Copy any list and paste to A35.
if your goal is only to find items occuring in all lists, choose the smallest list.
if you would like to analyse, choose the largest list or even multiple lists.
you could include all items by copy/paste TRANSPOSE the entire table to new sheet. then you have less than 30 colums. copy paste each into one column and delete duplicates of this list with data--> remove duplicates.
Now you need to create a formula in cell B35 that searches for the string in A35 in the range B1:B30. You drag the formula all the way right and down.
=COUNTIF(B$1:B$30,$A30)
The results will be the count of each item found in each list. In order to see if any item is in all lists, then all columns within the specific row should count at least 1 item. To the right of the results, see what the minimum value in the row is with:
=MIN(B35:API35)
(assuming your table ends in column API)
If any of your rows have a minimum of 1, then the item is included in all lists.
You could then also sum up the line to see which items occur the most and you could use the "max" instead of "min" to see if any list has duplicates.
Please try to use this
If it will not work I can help you with Macro VB code.
Logic will be as below:
1. Keep 1st column as base to check all the other column
2. Check each 30 cell of the 1st column in a loop with all the other column cell.
3. Stop the loop, if you don't the value in an entire column.

Find column first, then value in column

I am having trouble figuring out how to write a function to return a value from a column. Let's say I have a big master list of excluded numbers with columns 1,2,3,4,5,6. In each column is a bunch of values, anywhere from 1-500, and each column can have repeat values or be missing values.
I'll regularly be getting large lists of values and their corresponding columns that I will need to verify are in or not in the master list.
If I get two columns of data, one of values and one of their corresponding columns to cross check in the master list, is there a function or group of functions that will do this?
Sort of like a VLOOKUP, but instead of starting at the left most column, it looks at the column that my list tells it to and then looks for the value my list has. I'm having trouble figuring it out with an INDEX/MATCH because the values can show up on different rows in each column since some columns have omitted numbers.
For the sake of an answer, a Comment from #tigeravatar:
=COUNTIF(INDEX(A:F,0,X),Y) where X is the column number and Y is the number you're looking for.

Sort one column to match another in excel

I have a spreadsheet and I need to match the two columns together. However "Dove code" is 3600 rows and "code 2" is 1100. They all have the same codes as you can see in the image but you can also see where it starts changing and I need to have the codes all line up so I can see the gaps. I have already arranged them all alphabetically and its the "code 2" that would need to match up to "Dove code
If the above solution would result in too much shunting and vba is not an option, there's another way. Copy the first column and use 'remove duplicates' on it. Now you have an index list, put numbers from 1 to x in the column on the right of it.
Insert a column between the two lists and right of the second one.
Assuming that the index list is in F and the numbers in G, put this formula in the cell right of the first cell in the larger list:
=VLOOKUP(A2,$F$2:$G$500,2,FALSE)
Adjust the range accordingly. Put the same formula in the cell right of the first cell in the shorter list, with of course C2 instead of A2. Copy both formules to the end of the list.
Now both columns have an index on every row. You can match them using data sort, but for that you need to add dummies in the index columns.
Put this formula in the cell right of your basic index list: =countif(B:B,G2)
And this one in the cell right of that: =countif(D:D,G2)
Now you know how many times each record arises in both lists. Just add extra numbers manually so that both formulas turn up the same result. You should be able to do that really fast. If you have 200 records that are used 2 times in the first column and not in the second one, just copy the index of those 200 records and paste them twice. The countif's will automatically update.
You can use an extra column to calculate the difference between the two counts and use data sort on your basic index list to sort on the diferences.
After that just use data sort.
IF my directions are clear enough, this shouldn't cost you more than 10 minutes.
Edit:
Here's an example: http://img14.imageshack.us/img14/6366/k8pg.jpg
Without VBA I do this (for columns with a limited number of mismatches!) by adding a formula such as =INDIRECT("A"&ROW())<>INDIRECT("B"&ROW()) in a helper column. Working downwards, every time you see a TRUE shunt the appropriate column down to suit. But it may be only just about viable for 1100 rows!

Resources