Customer has multiple rows and want to combine them in Excel - excel

I have order data that breaks up orders by each individual item in the user's cart. This means that if a customer purchased 3 items, then they would have 3 rows in my spreadsheet. What I'm hoping to do is ONLY have 1 row per customer. Below is what my data currently looks like:
Customer Name Item Number Item
Derek 1 Shirt (Blue)
Derek 2 Shirt (Red)
Derek 3 Shirt (Yellow)
Amy 1 Shirt (Red)
Amy 2 Shirt (Yellow)
I would ideally like my data to looks like the following:
Customer Name Item Item 2 Item 3
Derek Shirt (Blue) Shirt (Red) Shirt (Yellow)
Amy Shirt (Red) Shirt (Yellow) BLANK
I have roughly 1000 customers in this dataset and around 5000 rows currently. Is there any way I can do this in Excel? My idea is creating a new table with a column named "Customer Name" and columns named "Item 1", "Item 2", etc. In the item 1 column, I use a formula that looks for the Item name if Customer Name in my new table matches the customer name in my original table AND the item number = 1. Then do the same for column "Item 2". I'm just not sure how to go about this.
Any help would be greatly appreciated. Thanks!

You need formula to filter data based on condition. You can use AGGREGATE() function with INDEX() formula to filter data based on condition to achieve your desired result. As per below screenshot put below formula to B10 cell then drag across down and right as need.
=IFERROR(INDEX($C$1:$C$6,AGGREGATE(15,6,ROW($1:$6)/($A$1:$A$6=$A10),COLUMN(A$1))),"")

Related

Selecting rows of a table from a column of another table

I have a column in "table1.xlsx" with more than 200 IDs.
ID
21321
54646
48949
...
And another "table2.xlsx" with the IDs plus all the information about the people.
Name Surname ID City
John Wayne 54646 Madrid
Mary Jane 11111 Berlin
Julius Randle 21321 Rome
Peter Parker 48949 New York
I would like to extract the rows from "table2" that match with the IDs from "table1". There is an easy way?
"table3.xlsx"
Name Surname ID City
John Wayne 54646 Madrid
Julius Randle 21321 Rome
Peter Parker 48949 New York
Open table1.xlsx, table2.xlsx and table3.xlsx in Excel.
Go to Table1.xlsx. Select column A by clicking on A. Above that Column, you will see a box where cell number typically shows up. Click inside that and type in MyIDs.
Go to table2.xlsx. Create a new field called Matching IDs like so:
In Cell E2, type the formula:
=VLOOKUP(C2, table1.xlsx!MyIDs, 1, FALSE)
Hit enter. This formula means, take C2 (from table2) and find a matching row in table1.xlsx's named table called MyIDs (which is column A of table1). Then, choose the 1st column (which is the only column) from MyIDs. FALSE means do an exact match not an approximate match.
Click on E2. Copy it. Paste it into E3..En. You can drag to copy as well. That'll populate the formula in each cell in E column like this:
Click on sort and filter like this:
Click on Matching IDs dropdown and de-select #N/A
Highlight all rows and cells from the filtered data like so:
Copy. Go to table3.xlsx. Paste. Remove the extra column called Matching IDs at the end in table3.xlsx

Excel: How to add a column from other sheet based on a key column?

I have 2 list. Both have a lot of column. I would like to insert a column from Sheet2 to Sheet1 based on a ceratin key column. Also sheet2 have much more rows than sheet1 so it ll be inserted only partly and still there ll be elements with no matches. For an example:
Sheet1:
Names ID Car Color
John 1 Audi Empty
Andy 4 Toyota Empty
Mike 3 BMW Empty
Tony 2 Suzuki Empty
Sheet2:
ID Cost Color
6 200 Blue
3 200 Red
4 300 Green
5 100 Red
1 50 Black
I would like to get the "color" from Sheet2 to Sheet1 by using the "ID". Using Excel 2010. I suspect I need INDEX+MATCH combination, but the examples I can find are not detailed and more simple so I coudn't figure out how to use them.
How about inserting this formula on Column D in the first row, then dropping the formula down:
=VLOOKUP(B1,Sheet2!$1:$1048576,3,FALSE)
Or to find the column that contains "Color", use Index Match Match, as follows:
=INDEX(Sheet2!$1:$1048576,MATCH(Sheet1!B2,Sheet2!A:A,0),MATCH("Color",Sheet2!$1:$1,0))
This will find the value in Column B in Sheet2 and give you the row number, then it will find the Column that contains "Color" and return the Column number, with those two numbers Index will return your color.

How to Summarise Positive / Negative Number without Adding New Column in Excel Pivot Table

Raw data is following format:
Name Team Talent
---------------------------
Quill Red 500
Drax Red -900
Ego Blue 2,000
Kraglin Red -200
Rocket Red 900
How can we make a pivot table like below without adding new column to original data:
Team Sum_Pos_Talent Sum_Neg_Talent
-----------------------------------------
Red 1,400 -1,100
Blue 2,000 0
Tried adding calculated fields, but the calculation is on the number on pivot table, not on each row of data.
You can use SUMIFS.
Sum_Pos_Talent
=SUMIFS($C$2:$C$6,$B$2:$B$6,E2,$C$2:$C$6,">0")
Where C2:C6 is the Talent column, B2:B6 is the Team Column, E2 is the name of the team in the other table.
Similarly Sum_Neg_Talent
=SUMIFS($C$2:$C$6,$B$2:$B$6,E2,$C$2:$C$6,"<0")
Sort the data to separate positives from negatives and insert a new row of headers between the two sets (say rename Talent to Sum_Pos_Talent and for inserted header switch to Sum_Neg_Talent). Then, assuming Team is in B1 (and in B5) create the PT from multiple consolidation ranges (B1:C4 and B5:C7) eg as here.

Extract Data from a Table in Excel Based On A Criteria

I have a list of data in 'Table1' on an Excel spreadsheet that looks like this:
Column A Column B
Pizza Sauce 3
Pepperoni 0
Cheese 1
Crust 2
Garlic 0
Sausage 0
From this list I want to be able to create a second list that, based on the value in B, shows the value in A. I want anything that is greater than 0 to show in this list (For an order sheet to give to a vendor). Like such:
Column A Column B
Pizza Sauce 3
Cheese 1
Crust 2
How might I go about doing this? I've looked around but haven't been able to do so successfully.
Why don't you use pivot table and filter out 0 value in column B. So every time you want an updated table, you just have to refresh the pivot table and your table is ready.
You can find pivot option in Insert -> PivotTable and provide the source data.

Merge multiple values in one column into same cell

EDIT: The intended output is to have one spreadsheet of the untouched IDs and commodity categories, and one spreadsheet with 1 occurrence of ID with the commodity categories combined. This is because I'm writing reports on total number of commodities and total number of unqiue incidents.
I have a spreadsheet that has an ID number across multiple rows with a commodity category and what I need to do is get the commodity categories associated with that ID number into the same cell. I'm seeing a lot of stuff about INDEX/MATCH but I'm not sure how it applied to my specific example.
Most examples are outputting data from the same column into the same row/multiple columns or something slightly different. I need to do this row about 600 rows and all have varying amount of rows and values. Some IDs have only one value, some have 40 values, and some have 2. Appreciate the help.
The intended input/output is below.
EX:
ID Commodity Category
A01-0301 Food and Beverage
A01-0301 Apparel and Accessories
A01-0301 Food and Beverage
A01-0302 Other
ID Commodity Category
A01-0301 Food and Beverage, Apparel and Accessories, Food and Beverage
A01-0302 Other
'Dirty' but might be adequate, assuming ID is in A1:
Sort by ID, copy last populated cell in ColumnA down one cell. In C2:
=IF(A1=A2,C1&","&B2,B2)
in D2:
=A2=A3
Select all, Copy, Paste Special, Values over the top, filter ColumnD to select TRUE and delete visible, adjust bottom entry.

Resources