mickeystanford_alumni
Board Regular
- Joined
- May 11, 2022
- Messages
- 129
- Office Version
- 2021
- Platform
- Windows
- MacOS
Hi everyone,
First of all, thank you very much in advance for your help.
I have a task where I need to consolidate 2 sheets (actually there are more but knowing the format of 1, I will manage to get the rest).
- Table 1 is the first sheet where I get data from companies and the quantities they sell from different origins and destinations. As you can see there are 3 companies (a,b,c) with a quantity and a name allocated.
- Table 2 is let's say a better and more updated version of sheet 1. Here, I have the breakdown of products (type, number, origin, destination), while as you can see in table 1 I only have like a consolidated estimation of where the sales are produced and where they go. However, as we can see, then we see that table 2 explicitly tells you quantity, type and destination.
What I have to do is to merge both tables with a format where I say:
FIRST
=if in table 1 and if in table 2, leave table 2 rows and delete table 1 (so there are no duplicates). Therefore, as we can see for company A we would have the first three rows. A parenthesis here, in row 3 of company A we see the type is sports+merchandising, so I would like to tell excel to say if sports+merchandising, duplicate the row with the quantity of sports, and the quantity of merchandising, so it would look like:
COMPANY NAME QUANTITY PRODUCT 1(SPORTS) PRODUCT 2(MACHINERY) PRODUCT 3(MERCHADISING) TYPE ORIGIN DESTINATION
A AA 30000 5000 MEXICO CHINA
A AA 30000 5000 MEXICO CHINA
SECOND
=if in table 1, but not in table 2, then keep table 1 (and put the name in RED so I have the alert)
THIRD
=if in table 2, but not in table 1, then keep table 2 (and put the name in RED so I have the alert)
I am struggling badly with this, so I would really appreciate your help.
Happy to clarify any doubts if arise and hope it is clear
TABLE 1
TABLE 2
First of all, thank you very much in advance for your help.
I have a task where I need to consolidate 2 sheets (actually there are more but knowing the format of 1, I will manage to get the rest).
- Table 1 is the first sheet where I get data from companies and the quantities they sell from different origins and destinations. As you can see there are 3 companies (a,b,c) with a quantity and a name allocated.
- Table 2 is let's say a better and more updated version of sheet 1. Here, I have the breakdown of products (type, number, origin, destination), while as you can see in table 1 I only have like a consolidated estimation of where the sales are produced and where they go. However, as we can see, then we see that table 2 explicitly tells you quantity, type and destination.
What I have to do is to merge both tables with a format where I say:
FIRST
=if in table 1 and if in table 2, leave table 2 rows and delete table 1 (so there are no duplicates). Therefore, as we can see for company A we would have the first three rows. A parenthesis here, in row 3 of company A we see the type is sports+merchandising, so I would like to tell excel to say if sports+merchandising, duplicate the row with the quantity of sports, and the quantity of merchandising, so it would look like:
COMPANY NAME QUANTITY PRODUCT 1(SPORTS) PRODUCT 2(MACHINERY) PRODUCT 3(MERCHADISING) TYPE ORIGIN DESTINATION
A AA 30000 5000 MEXICO CHINA
A AA 30000 5000 MEXICO CHINA
SECOND
=if in table 1, but not in table 2, then keep table 1 (and put the name in RED so I have the alert)
THIRD
=if in table 2, but not in table 1, then keep table 2 (and put the name in RED so I have the alert)
I am struggling badly with this, so I would really appreciate your help.
Happy to clarify any doubts if arise and hope it is clear
TABLE 1
COMPANY | NAME | QUANTITY | PRODUCT TYPE | ORIGIN | DESTINATION |
A | AA | 30000 | USA+MEXICO | EUROPE | |
B | BB | 20000 | USA+MEXICO | CHINA | |
C | CC | 15000 | USA | RUSSIA |
TABLE 2
COMPANY | NAME | QUANTITY | PRODUCT 1 (SPORTS) | PRODUCT 2 (MACHINERY) | PRODUCT 3 (MERCHANDISING) | TYPE | ORIGIN | DESTINATION |
A | AA | 30000 | 10000 | SPORTS | USA | EUROPE | ||
A | AA | 30000 | 10000 | SPORTS | USA | EUROPE | ||
A | AA | 30000 | 5000 | 5000 | SPORTS+MERCHANDISING | MEXICO | CHINA | |
B | BB | 20000 | 10000 | SPORTS | USA | CHINA | ||
B | BB | 20000 | 10000 | MERCHANDISING | USA | RUSSIA | ||
D | DD | 10000 | 10000 | SPORTS | USA | EUROPE |