TheRedCardinal
Active Member
- Joined
- Jul 11, 2019
- Messages
- 250
- Office Version
- 365
- 2021
- Platform
- Windows
Hi all,
I have hit a problem with my work project and it's one of those where I can't even begin to design the solution never mind implement it! I hope you guys can help!
I have provided a sample workbook here.
https://drive.google.com/open?id=1u30oLh9SavbDpc3YVfoWGCEGJZ7Aqpeu
The process works as follows (the spreadsheet has no macros on it I've prepared this manually but most of these steps are automated in the operating version.
The macro brings in two tables of data - one called Logistics and one called Sales. You can see these on the Raw Data sheet colour coded.
Then a pivot is made to identify differences between Amount and VAT value of each invoice listed. This is because the two systems report different values and the "VAT Value" is normally the correct one.
Regardless, the user is invited to determine the correct treatment but in general, where "VAT value" is higher than "Amount" we can assume VAT value is correct.
We then continue to the Logistics data which is replicated in Final Data tab. This contains more fields than value which need to be reported so can't be ignored.
I use a lookup to populate the field "Amount" with the value that the user has settled on in the Pivot tab.
The problem is, some invoices have more than one line because a key header, Commodity Code, varies on invoices. However as predicted, the Vlookup finds the invoice and returns the total value for each line. This is incorrect.
What I need my macro to do is:
- identify lines in the Final tab that are duplicated
- then identify the difference from the pivot table for that invoice
- if the difference is zero, simply import the amount from the original data table instead
- if the difference is not zero, apportion the difference by % of weight/total weight for each line
I have set out a working example in the attached workbook.
Is this something that can be automated?
Thanks!
I have hit a problem with my work project and it's one of those where I can't even begin to design the solution never mind implement it! I hope you guys can help!
I have provided a sample workbook here.
https://drive.google.com/open?id=1u30oLh9SavbDpc3YVfoWGCEGJZ7Aqpeu
The process works as follows (the spreadsheet has no macros on it I've prepared this manually but most of these steps are automated in the operating version.
The macro brings in two tables of data - one called Logistics and one called Sales. You can see these on the Raw Data sheet colour coded.
Then a pivot is made to identify differences between Amount and VAT value of each invoice listed. This is because the two systems report different values and the "VAT Value" is normally the correct one.
Regardless, the user is invited to determine the correct treatment but in general, where "VAT value" is higher than "Amount" we can assume VAT value is correct.
We then continue to the Logistics data which is replicated in Final Data tab. This contains more fields than value which need to be reported so can't be ignored.
I use a lookup to populate the field "Amount" with the value that the user has settled on in the Pivot tab.
The problem is, some invoices have more than one line because a key header, Commodity Code, varies on invoices. However as predicted, the Vlookup finds the invoice and returns the total value for each line. This is incorrect.
What I need my macro to do is:
- identify lines in the Final tab that are duplicated
- then identify the difference from the pivot table for that invoice
- if the difference is zero, simply import the amount from the original data table instead
- if the difference is not zero, apportion the difference by % of weight/total weight for each line
I have set out a working example in the attached workbook.
Is this something that can be automated?
Thanks!