Microsoft Excel Query - Formatting Columns

0

I have got an excel sheet data that looks like this:

enter image description here

Order Id    Rate    Item    Quantity
XXX          4      Ball      100
XXX          4      Hockey    500
XXX          4      Hockey    500
AAA          3      Ball      200
AAA          3      Ball      300
AAA          6      Helmet    800
AAA          6      Helmet    100

I need to get the Quantity Subtotaled under the same orderId and Rate and the different Items under the same order to be separated by comma under Item. Basically the output should look like this :

Order Id    Rate      Item     Quantity
XXX          4   Ball, Hockey   1100
AAA          3       Ball       500
AAA          6      Helmet      900

Output screenshot in excel -

enter image description here

Rahul

Posted 2015-02-13T12:58:32.487

Reputation: 1

Raystafarian's answer is pretty close and certainly the least painful. However, if you really need all the item data to be in a single cell, you're stuck with one of two options: 1) PivotTable with complicated formulas that get really messy if the number of items changes OR 2) VBA. Which route is preferable? – Engineer Toast – 2015-02-13T13:14:04.887

I agree with @eng - this will require VBA – Raystafarian – 2015-02-13T15:07:16.720

Answers

2

Sounds like a job for pivot table!

Select the range and go to Insert - Pivot Table

For row labels, you can use rate and order id

For column labels you can use item

And you can sum the values of qty

click for larger

enter image description here

Raystafarian

Posted 2015-02-13T12:58:32.487

Reputation: 20 384

1You can get a bit closer to the desired output by changing to classic layout and repeating item labels for order id – Engineer Toast – 2015-02-13T13:12:50.757

@EngineerToast Unfortunately I have 2007 on this computer, but this would definitely work for OP with 2010 – Raystafarian – 2015-02-13T13:21:45.243

@Rahul, remember if this post answers the question or is helpful, mark as answer (green tick) or upvote (or both)! – Dave – 2015-02-13T13:23:50.167

Hi Friends Can't use the pivot table. I have attached the result as reqd. The data I have posted in example is just an example. Actual data is huge and also the pivot creates different rows for the Items here so it would become a massive table. The result I need is similar to highlighted in screenshot - ( http://screencast.com/t/0UJ7H9IAI7) - items separated by comma

– Rahul – 2015-02-13T15:02:41.510

I don't understand why it takes out http from front. It is(please ignore spaces in between) - http : // screencast.com/t/0UJ7H9IAI7 – Rahul – 2015-02-13T15:06:18.417