excel merge rows based on column values - excel

So I've been searching for the information I need and have not really been able to find a simple solution, though it seems like there should be one. Basically, I have the following
John | Doe | 123 Wallaby Ln | 00123 | | |
John | Doe | | 00123 | xxx | yy |
Jane | Doe | | 01234 | | zz |
Jane | Doe | bleep blop ln | | xx | |
And I need
John | Doe | 123 Wallaby Ln | 00123 | xxx| yy |
Jane | Doe | bleep blop ln | 01234 | xx | zz |
Basically pretty simple, I need to merge cells with the same Column 1 & Column 2 data to get as comprehensive and concise a list of data. You'd think this would be readily available through google as a simple formula but I have only found VBA solutions (I have never used VBA before, or macros for that matter so I'm not sure how to use them or fix errors in them). Any help is greatly appreciated.
Thanks in advance!

The easiest option is to merge the content of A & B in one column ( insert a new column in C)
C1 =A1&" "&B1
Roll down the formula
Sort per column C
Make sure you have descriptive name on row 1 to describe your column.
Select the complete table
Create a pivot table, drop the C column in the row section to obtain the list of unique name.
Copy the list of unique names in a new sheet
and then look at vlookupall describe here excel vlookup with multiple results to create your own function.

Related

Find data in other row from data in another row in excel spreadsheet

I have a spreadsheet like so:
| A | B | C |
|------|---|----------------|
| Bob | | Mary is Nice |
| Mary | | Tim is happy |
| Tim | | Bob is awesome |
and I'm trying to use Excel to find the name values in column A and match the content in column C and then match the output in column B like so:
| A | B | C |
|------|----------------|----------------|
| Bob | Bob is awesome | Mary is Nice |
| Mary | Mary is Nice | Tim is happy |
| Tim | Tim is happy | Bob is awesome |
I'm not sure if there is a formula that can find, match, and sort into column B out of the box. Or if I would need to write a macro. I've been looking and the only thing I can find so far is a match based of a specific value and move it into a seperate worksheet.
I can do this with PHP/MySQL, but that's not the intended result, obviously.
Also, maybe something easier to do within Google Sheets instead?
Use INDEX/MATCH with wild cards:
=INDEX(C:C,MATCH("*"&A1&"*",C:C,0))
OR
VLOOKUP:
=VLOOKUP("*"&A1&"*",C:C,1,FALSE)

How to split text after checking length in Google Sheets?

How do I split contents of a cell if the cell is not empty in Google spread sheet?
Name | DOB | Day | Month | Year
------------------------------------------
John | 01/01/1995 | 1 | 1 | 1995
Doe | | | |
Dane | 10/05/1988 | 10 | 5 | 1988
Since Doe doesn't have a date of birth, the value for day, month and year is empty.
I am currently using
=ArrayFormula(SPLIT(B1,"/"))
How to check the condition before splitting?
Posting the answer as it worked for you,
=IF(B1="","",arrayformula)
There seems no need to make any special provision for blanks (nor need for any formula). Copy the DOB column (excluding header) under Day and apply Data > Split text into columns... with Custom Separator of /.

Repeat formula until next occurrence in another cell

I'm having troubles creating an Excel formula to repeat the same copy down a column until I come to a new "person". The reason I'm doing this is to Index(Match) later to grab all this data. If I am totally off, and there's an easier way to grab this data than run a formula down 15k rows, I'm all ears. The main problem is that my categorical data (Person) is stacked on top of the data that I want to match it with (Work Positions).
The data looks like this:
Description | Status
Bob | C
Sales |
Marketing |
Management |
John | C
Sales |
Management |
Tony | C
Management |
Ideally, I'd like the data to look like this after running the formula down ColA:
Person | Description | Status
Bob | Bob | C
Bob | Sales |
Bob | Marketing |
Bob | Management |
John | John | C
John | Sales |
John | Management |
Tony | Tony | C
Tony | Management
I've tried writing an If() statement to target the "C" in ColC, as it is always there to discern a change in "Person". However, I can't figure out how to do this as of yet. Is there a way to write a formula that says keep pasting the same value until you hit the next "C", then change your paste value? Thanks for any and all help and please, don't hesitate to ask any clarifying questions!
=IF(C:C="C",B:B,A1)
Put this in A2 and clear "Person" then drag down the list.

Check if cells match in two columns and, if they do, copy a related value

Given a column A of 100 names and another B of numbers, where column C contains a subset of those numbers how might I populate column D with the matching name? A match is where the names in A and D are next to the same number. For example, A, B and C are inputs and D the desired output:
____A______B_______C_______D____
1 |Larry | 11111 | 22222 | Bob |
2 |Bob | 22222 | 44444 | Steve |
3 |Mike | 33333 | 55555 | Jim |
4 |Steve | 44444 | | |
5 |Jim | 55555 | | |
Please try in D1 and copied down to suit:
=INDEX(A:A,MATCH(C1,B:B,0))
Not quite sure if this is what you are looking for, but a Vlookup function should help you greatly. I used a helper column to link C1 = A1, C2=A2 and so on. You can hide this column if you need to. You can then use the formula shown below in cell E1 and drag it down. As you put numbers in column D, the name will automatically fill in column E with the matching code.

Moving range/array reference in Excel table

Friends, I'm hoping you can help. I'm fairly certain I found a solution to this problem below a while ago, but silly me didn't write it down and now I can't remember how I did it. I'm drawing a blank on what to search for (Google is flooded with answers on "dynamic named ranges", which is not what I'm aiming for here). So, the question:
How can I define a range within a formula (say, RANK for example) that moves as I progress down through a table? I'm trying to avoid using INDIRECT, because it becomes a bit of a memory/processor hog when repeated throughout a large table. Pretty sure there is another way, maybe with INDEX or MATCH?
A simplified version of the data would appear as follows:
Column A has a bunch of reference numbers, each one repeats a few times.
Column B has a bunch of timestamps
Column C is where I would like to rank the timestamp in column B, as compared to all other timestamps that share the same reference number in column A.
The result set should look like this:
| A | B | C |
| abc123 | 01/01/2014 12:30 | 1 |
| abc123 | 01/02/2014 12:30 | 2 |
| abc123 | 01/02/2014 13:30 | 3 |
| abc123 | 01/03/2014 09:30 | 4 |
| def456 | 01/01/2014 12:30 | 1 |
| def456 | 01/01/2014 12:45 | 2 |
| xyz987 | 01/02/2014 12:30 | 1 |
| xyz987 | 01/02/2014 16:30 | 2 |
| xyz987 | 01/03/2014 11:30 | 3 |
Any ideas on what would be the least taxing solution for the processor in this case?
So here is the trick:
copy and paste in C1 and drag and fill down till end.
=IF(A2=A1;SUMPRODUCT(--(A$1:A$9=A1);--(B1>B$1:B$9))+1;SUMPRODUCT(--(A$1:A$9=A1);--(B1>B$1:B$9))+1)
this is an array formula, so press ctrl+shift+enter to calculate the formula
Here is the example sheet in this file downloadable from this link
P.S. remember to adjust the formula to your regional settings by replacing the ";" with "," . Have fun.

Resources