I have a Summary tab in an Excel file that needs to look at an Accruals tab to find a
Min. The problem I am having is that there are many different Location/Commodity combinations and I need to find the
Min based on the Location/Commodity combination. Location and Commodity are in two separate columns.
location 123 can have a
Location 123 Commodity 01 can have several different prices. I need to look up
commodity 01 and find the max of those prices.
I have been asked not to use an
array as it slows the files down. I was previously attempting to use
=MAX(IF()) but that was not preferred.
How can I find values on the Accruals tab based on the location column AND the commodity column matching from the Summary tab and then get the max of those values based on the loc/comm combination? Is there a more simple way through VBA? I was trying to write a loop but I am not very advanced and having some difficulty.
I hadn’t really thought about a pivot table. My prior experience with those haven’t been great, but this seems to be able to give me exactly what I need.
I created two pivot tables – one for max, one for min and then used the GETPIVOTDATA() function on the Summary tab to pull in those values based on location and commodity combination.
Thank you all for your help!