vendredi 18 janvier 2019

How to stack two columns from different worksheets into one using a value

I have two worksheets A and B

I want to combine columns from A123 and B123 to produce 1 whole data (Worksheet C123)...the reason i cant copy and paste is some of the column labels dont match and it includes different sets of data.

So I have created 1 worksheet which matches the same column labels for both

Now to combine i have example of below data

Worksheet A123 A B RetailNew Retail Name 1 RetailNew Retail Name 2 RetailNew Retail Name 3 RetailNew Retail Name 4 RetailNew Retail Name 5

Worksheet B123 A B RetailOld Retail Name 123 RetailOld Retail Name 44 RetailOld Retail Name 77 RetailOld Retail Name 465 RetailOld Retail Name 543 RetailOld Retail Name 643 RetailOld Retail Name 72 RetailOld Retail Name 83 RetailOld Retail Name 96

Worksheet C123 - Here i want to combine Worksheets A123 and B123 together as per below A B RetailNew Retail Name 1 RetailNew Retail Name 2 RetailNew Retail Name 3 RetailNew Retail Name 4 RetailNew Retail Name 5 RetailOld Retail Name 123 RetailOld Retail Name 44 RetailOld Retail Name 77 RetailOld Retail Name 465 RetailOld Retail Name 543 RetailOld Retail Name 643 RetailOld Retail Name 72 RetailOld Retail Name 83 RetailOld Retail Name 96

I have managed to stack columns A for both worksheet, however because the number of columns dont match both worksheets i am not able to stack columns B on both worksheets as when I drag the formula used below down the RetailNew returns ok but the Retailold returns only half of the data, as both worksheets have different sets of data.

=IF(A:A=RetailNew!A:A,RetailNew!B:B,IF('Consolidated Data'!A:A=RetailOld!A:A,Retailold!B:B,Retailold!B:B))

Please could you let me know a formula where i am able to return the correct data based on the number of columns

Aucun commentaire:

Enregistrer un commentaire