I am trying to create a VBA macro to automatically calculate a three-month rolling average. Given a large spreadsheet of imported data, format seen below, I need to isolate in on the prior three months of invoices given a project designation, account code, and PO number. While the project designation is unique and will only appear once, account codes and PO numbers can and will be repeated very often.
Focusing on the second image...assuming it is June 2020, I want to determine the rolling average of the PO# 123456 in account 567101 of project 123EF123. The desired rows are highlighted in green. Additionally, there may be instances where multiple invoices of the same PO were incurred in one month, as seen in account 567202 with the blue highlighted rows.
I have absolutely no idea of how to proceed in automating this process. Any and all help would be greatly appreciated!
If this seems like it would be too much to do, even having the ability to quickly bring the block of data of the associated account to the active sheet would be fantastic.
Focusing on the second image...assuming it is June 2020, I want to determine the rolling average of the PO# 123456 in account 567101 of project 123EF123. The desired rows are highlighted in green. Additionally, there may be instances where multiple invoices of the same PO were incurred in one month, as seen in account 567202 with the blue highlighted rows.
I have absolutely no idea of how to proceed in automating this process. Any and all help would be greatly appreciated!
If this seems like it would be too much to do, even having the ability to quickly bring the block of data of the associated account to the active sheet would be fantastic.