Grouping rows in table in Excel - excel

I have the following table:
First Name Second Name Phone
A B 1
A B 2
C D 3
C D 4
I would like to get the required table (Every values in columns A and B that repeats will appear only in the first line of occurrence):
First Name Second Name Phone
A B 1
2
C D 3
4

You can accomplish this by using Pivot Tables.
Out of my head, you have to structure it like this:
Rows
First Name
Second Name
Phone
And it will show it the way you want it. You can change the show/hide for (sub)totals to change the result a bit.
If you want the First name and Second name on the same row, you will have to edit the Pivot Table to use Classic display.

Related

How to duplicate and sync tables based on ID column in Excel?

I'd like to duplicate a table in Excel onto a different worksheet, add columns to the new table, and keep the rows synced.
(p.s I'm not sure how to add images of the Excel sheet in here?)
For example, I have a table (Table1):
ID Data
A 1
B 2
C 3
D 4
I'd like to duplicate it in another sheet (Table2) and add a column that's only in the new table:
ID Data Data2
A 1 a
B 2 b
C 3 c
D 4 d
And I'd keep the rows synced, so that if I add, delete or amend a row in the original table (Table1), the new table (Table2) remains consistent including the added column that only exists in the new table.
For example, if I delete the row with ID "B" in the original table, I'd like this to happen in the new table:
ID Data Data2
A 1 a
C 3 c
D 4 d
I've been able to duplicate the table via a connection or query, but the added column in the new table doesn't stay in sync. For example, at the moment if I delete the row with ID "B" in the original table, this happens in the new table:
ID Data Data2
A 1 a
C 3 b
D 4 c
The columns that are in the original table update correctly, while the new column seems to be ignored.
I need to use Excel and if possible without VBA, but if VBA is the only way this will work then I'll need to use it.
I'm pretty desperate so any tips in the right direction would be gratefully received!!

Find duplicates with a suffix in excel and keep results

I have a spreadsheet with a list of items in one column (A) and in column C shows the total sold. I'm trying to find all the items within column A.
The issue is, some items are the same, only they have a suffix, mostly separated by a -. The values in column C would be different as well.
Example:
ABC = 5
ABC-123 = 3
ABC-543 = 2
I'm looking to identify only 123 and then combine all the values, so that it will show ABC and 10 as the total.
I've looked around how to remove the duplicate suffix, but have so far failed to find a method when trying to add the total values.
Many thanks
do you mean the data you have looks like this:
column A column B column C
ABC 5
ABC-123 3
ABC-543 2
if so, you can select column A then go to data then text to columns then delimited select other by putting - sign, next and finish.
result must be:
column A column B column C
ABC 5
ABC 123 3
ABC 543 2
then you can =sumifs(C:C;A:A;"ABC") (keep in mind that column B must be empty)
if you have ABC-123 = 3 in the same cell as a text, then you can do:
=IF(SEARCH("ABC";F3);RIGHT(F3;LEN(F3)-FIND("=";F3)-1);"")
where F3 is equal to ABC-123 = 3 The formula above searches fo ABC and gives you a value after = sign, no matter how long this value is. If there is no ABC it will return an error.
if there is no need to look for ABC then just use:
=RIGHT(F3;LEN(F3)-FIND("=";F3)-1)
I hope this helps. I cannot comment, so ask if you have questions.
Best - AB

EXCEL match 2 columns against each other

I have two columns of data, they look something like this:
A B C D
1 2 SOME RECORD
2 6 SOME RECORD
3 10 SOME RECORD
4
5
6
7
8
9
10
So basically column A is a list of indices, where some of them appear in column C with corresponding records saved in column D. Column B is currently empty, and what I want to do is if say index 2 appears in both column A and column C (they matches), then put the record beside C2 in the cell B2. So essentially I want it to look like this:
A B C D
1 2 SOME RECORD
2 SOME RECORD 6 SOME RECORD
3 10 SOME RECORD
4
5
6 SOME RECORD
7
8
9
10 SOME RECORD
Can someone help please?!! Thanks!!!
UPDATE: I tried this and it doesn't work. The data in column D is calculated using a UDF and is refreshing every 1 second. The VLOOKUP function fails even though I can see the 2 indices are the same!! Is it because of the format of the cell or column? I.e. does vlookup compare data type as well?
Assuming your data in A starts from A1 - put in B1 the following and autofill:
=IFERROR(VLOOKUP($A1,$C:$D,2,0),"")
This includes handling of missing values.
You'll want this:
B1=VLOOKUP(A1, C:D, 2, FALSE)
This will look up the value in column A within the array spanning columns C and D. It will give you the value found in the second column (D). FALSE makes it an exact match, otherwise you might get 2 and 20 matching because hey, they're kind of similar...

Merge unique values if another cell matches

Merge all unique values if another cell matches. I already know how to merge cells but now some information is double. So what I would like to achieve is the following:
if column A has the same name, then all values given in column B for
that name must be given only ONCE in a new column.
My data has a row names and a row mode, for example (Row 1 is header)
A B
2 Brenda a
3 Brenda a
4 Joey a
5 Joey b
So I want:
E
2 a
3
4 a,b
5
I already did merge the modes in column 3:
=IF(A1<>A2;B2;C1&","&B2)
So I get in this example:
C
2 a
3 a,a
4 a
5 a,b
Then, I already did that only the first record get the additional modes in column 4:
=IF(A1=A2;"";INDEX(Sheet1!$C:$C;COUNTIF(Sheet1!$A:$A;$A2)+MATCH($A2;Sheet1!$A:$A;0) -1))
So I get in this example
D
2 a,a
3
4 a,b
5
Now I need a column that only uniques values are given for each name. So in this example:
E
2 a
3
4 a,b
5
If I am understanding how your data is structured, try this:
Add a new column, say column G for ease of explanation, that concatenates the name and mode in each row. So, cell G2="Brendaa", G3="Brendaa", G4="Joeya", G5="Joeyb", etc.
In your merge step you will test whether the current value in the cell for this column matches any previous values in the column: If no, you do the merge; if yes, you don't.
Your merge formula would change to something like the following:
=IF(A1<>A2,B2,IF(ISERROR(VLOOKUP(G2,G$1:G1,1,0)),C1&","&B2,""))
Then you would the next step as before.

Compare two Excel columns, output cells in A that do not appear in B

I am trying to compare two columns in excel, A and B. Column A contains a complete list of customer numbers. Column B contains an incomplete list of the same customer numbers. So if a customer number is in A, but not in B then output that number to column C.
I'd use the MATCH function in combination with ISNA.
If I have the following table
A B C
1 4
2 3
3 1
4 7
5 2 5
6 6
7
I put in column 'A' the full customer list, and in column B is a random ordered partial list. I then put the function in C1 (and the rest of column C):
=IF(ISNA(MATCH(A1,B:B,0)),A1, "")
Now I see the values '5' and '6' only in column C, because those are the only two numbers that don't appear in column B.
In Cel C1 =IF(ISERROR(VLOOKUP(A1,$B$1:$B$10,1,FALSE)),A1,"")
Adjust for row counts and fill down against column A.
I think you're looking for something like this:
=IF(ISERROR(MATCH(A1,B1,0)),A1,"")
Propegate that formula along your new column and it'll reprint the populated Column A when Column B is a no match.
Reference URL: http://support.microsoft.com/kb/213367
(I believe I read the original question wrong, and am going on the assumption that column A and B are already sorted where the values will line up.)

Resources