In my first sheet I have the raw data. My second sheet is where I post all the percentages for the data. Basically I am tracking how many business packages for each state. In the second sheet, I want to know the max number of packages that have been sold per state. In order to do this I did the following formula:

=MAX(IF('Raw Data'!C:C=A3,IF('Raw Data'!B:B="55Y",'Raw Data'!H:H)))

What that does is it filters column C for what A3 is on sheet 2. In this case it was PU which is the type of package sold. Then it filters the level of the package between two types 32X and 55Y. Then it looks down column H to find the highest value and returns that number. After a control-shift-enter it shows up fine.

Now for the next column, I want to do all the above, but I want to show the State it was purchased in, instead of the max number. I have messed around with the index formula, but the closest I could get was:

=INDEX('Raw Data'!A:A,MAX(IF('Raw Data'!C:C=A3,IF('Raw Data'!B:B="55Y",'Raw Data'!H:H))))

The problem with this is it finds the first highest occurrence and then puts the state, but it is like it ignores the two IF statements in the MAX formula. If there are any duplicates, it finds the first one on the list and puts the state without see if column C and B match column H.