lukasvjohansson
New Member
- Joined
- Jun 26, 2018
- Messages
- 27
Hi!
I've searched the forum and found some really useful stuff (thanks a lot!), however, im still not reaching the goal and even though I think I have most of the formulas I need, I still have some problem with the logic.
I am currently working on a windows microsoft office excel standard 2016 version 16.0.4639.1000.
The table A below represents a subset of my data, FYI I have about 15 000 rows. Each row represents one customer order, with e.g. destination, product type, and price. There are rows with duplicate customer ID, product type and destination as one row is one order and the same order can have been made several times. I would now like to transform this data to a list of "Top 10 destinations travelled with e.g. product type Flight for Customer X".
Table A
[TABLE="class: grid, width: 750"]
<tbody>[TR]
[TD]Customer ID[/TD]
[TD]Department[/TD]
[TD]Product type[/TD]
[TD]Destination[/TD]
[TD]# bookings[/TD]
[TD]# one way tickets[/TD]
[TD]Price[/TD]
[/TR]
[TR]
[TD]Ritchie travel[/TD]
[TD]GRP[/TD]
[TD]Flight[/TD]
[TD]Barcelona - London[/TD]
[TD]2[/TD]
[TD]2[/TD]
[TD]100[/TD]
[/TR]
[TR]
[TD]Jazz Art travel
[/TD]
[TD]PRIV[/TD]
[TD]Hotel[/TD]
[TD]- Stockholm[/TD]
[TD]1[/TD]
[TD]1[/TD]
[TD]123[/TD]
[/TR]
[TR]
[TD]Redeye AB[/TD]
[TD]AFF[/TD]
[TD]Boat[/TD]
[TD]Stockholm - Kirkenes[/TD]
[TD]1[/TD]
[TD]1[/TD]
[TD]456[/TD]
[/TR]
[TR]
[TD]Spot on travel[/TD]
[TD]AFF[/TD]
[TD]Train[/TD]
[TD]Stockholm - Visby[/TD]
[TD]4[/TD]
[TD]3[/TD]
[TD]122[/TD]
[/TR]
[TR]
[TD]Spot on travel[/TD]
[TD]AFF[/TD]
[TD]Flight[/TD]
[TD]Barcelona - London[/TD]
[TD]3[/TD]
[TD]3[/TD]
[TD]100[/TD]
[/TR]
[TR]
[TD]Spot on travel[/TD]
[TD]AFF[/TD]
[TD]Flight[/TD]
[TD]Visby - Stockholm[/TD]
[TD]2[/TD]
[TD]2[/TD]
[TD]92[/TD]
[/TR]
</tbody>[/TABLE]
Table B - Only including e.g. Flight and AFF+GRP and Ritchie travel
[TABLE="width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]Destination[/TD]
[TD]# bookings[/TD]
[TD]# one way ticket[/TD]
[TD]Price[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]8[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]9[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]10[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Since I have a quite large database, I would like to find a solution where I dont have to "refer to the destinations" themselves (i.e. deleting duplicate values, and then countif) since I have about 1700 different destination combinations. I hope that you understand my explanation, otherwise please ask me to specify further.
I would like to structure the solution in something similar to Table C if possible, in order to be able to refer to the product type and then just copy the formula for all different product types.
Table C - For AFF+PRIV + Customer X
[TABLE="width: 500"]
<tbody>[TR]
[TD]Destination[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Flight[/TD]
[TD]Flight[/TD]
[TD]Flight[/TD]
[TD]Hotel[/TD]
[TD]Hotel[/TD]
[TD]etc.[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Destination[/TD]
[TD]# bookings[/TD]
[TD]# one way tickets[/TD]
[TD]Destination[/TD]
[TD]# booking[/TD]
[TD]etc.[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Stockholm-London[/TD]
[TD]x[/TD]
[TD]x[/TD]
[TD]- Stockholm[/TD]
[TD]x[/TD]
[TD]x[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD].[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD].[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD].[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
At this point I have tried to first create a "helper" column that assigns a number and decimals, then rows, index, match, large and mode-formulas to find the appropriate name and number to each destination and the results are fine on a total level, but I can't figure out how to add the multiple conditions of product type, department and customer ID. I suspect that I might have done something wrong when summing the numbers up for each destination which limits me from adding the conditions in a large-formula later on. If you want to see the exact formulas ive used I can post them asap, but I currently have them on my other computer in Swedish due to my employer.
I would be very grateful for any assistance!
Best
Lukas
I've searched the forum and found some really useful stuff (thanks a lot!), however, im still not reaching the goal and even though I think I have most of the formulas I need, I still have some problem with the logic.
I am currently working on a windows microsoft office excel standard 2016 version 16.0.4639.1000.
The table A below represents a subset of my data, FYI I have about 15 000 rows. Each row represents one customer order, with e.g. destination, product type, and price. There are rows with duplicate customer ID, product type and destination as one row is one order and the same order can have been made several times. I would now like to transform this data to a list of "Top 10 destinations travelled with e.g. product type Flight for Customer X".
Table A
[TABLE="class: grid, width: 750"]
<tbody>[TR]
[TD]Customer ID[/TD]
[TD]Department[/TD]
[TD]Product type[/TD]
[TD]Destination[/TD]
[TD]# bookings[/TD]
[TD]# one way tickets[/TD]
[TD]Price[/TD]
[/TR]
[TR]
[TD]Ritchie travel[/TD]
[TD]GRP[/TD]
[TD]Flight[/TD]
[TD]Barcelona - London[/TD]
[TD]2[/TD]
[TD]2[/TD]
[TD]100[/TD]
[/TR]
[TR]
[TD]Jazz Art travel
[/TD]
[TD]PRIV[/TD]
[TD]Hotel[/TD]
[TD]- Stockholm[/TD]
[TD]1[/TD]
[TD]1[/TD]
[TD]123[/TD]
[/TR]
[TR]
[TD]Redeye AB[/TD]
[TD]AFF[/TD]
[TD]Boat[/TD]
[TD]Stockholm - Kirkenes[/TD]
[TD]1[/TD]
[TD]1[/TD]
[TD]456[/TD]
[/TR]
[TR]
[TD]Spot on travel[/TD]
[TD]AFF[/TD]
[TD]Train[/TD]
[TD]Stockholm - Visby[/TD]
[TD]4[/TD]
[TD]3[/TD]
[TD]122[/TD]
[/TR]
[TR]
[TD]Spot on travel[/TD]
[TD]AFF[/TD]
[TD]Flight[/TD]
[TD]Barcelona - London[/TD]
[TD]3[/TD]
[TD]3[/TD]
[TD]100[/TD]
[/TR]
[TR]
[TD]Spot on travel[/TD]
[TD]AFF[/TD]
[TD]Flight[/TD]
[TD]Visby - Stockholm[/TD]
[TD]2[/TD]
[TD]2[/TD]
[TD]92[/TD]
[/TR]
</tbody>[/TABLE]
Table B - Only including e.g. Flight and AFF+GRP and Ritchie travel
[TABLE="width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]Destination[/TD]
[TD]# bookings[/TD]
[TD]# one way ticket[/TD]
[TD]Price[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]8[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]9[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]10[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Since I have a quite large database, I would like to find a solution where I dont have to "refer to the destinations" themselves (i.e. deleting duplicate values, and then countif) since I have about 1700 different destination combinations. I hope that you understand my explanation, otherwise please ask me to specify further.
I would like to structure the solution in something similar to Table C if possible, in order to be able to refer to the product type and then just copy the formula for all different product types.
Table C - For AFF+PRIV + Customer X
[TABLE="width: 500"]
<tbody>[TR]
[TD]Destination[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Flight[/TD]
[TD]Flight[/TD]
[TD]Flight[/TD]
[TD]Hotel[/TD]
[TD]Hotel[/TD]
[TD]etc.[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Destination[/TD]
[TD]# bookings[/TD]
[TD]# one way tickets[/TD]
[TD]Destination[/TD]
[TD]# booking[/TD]
[TD]etc.[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Stockholm-London[/TD]
[TD]x[/TD]
[TD]x[/TD]
[TD]- Stockholm[/TD]
[TD]x[/TD]
[TD]x[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD].[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD].[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD].[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
At this point I have tried to first create a "helper" column that assigns a number and decimals, then rows, index, match, large and mode-formulas to find the appropriate name and number to each destination and the results are fine on a total level, but I can't figure out how to add the multiple conditions of product type, department and customer ID. I suspect that I might have done something wrong when summing the numbers up for each destination which limits me from adding the conditions in a large-formula later on. If you want to see the exact formulas ive used I can post them asap, but I currently have them on my other computer in Swedish due to my employer.
I would be very grateful for any assistance!
Best
Lukas