MAX Function Formula

acool

Board Regular
Joined
Feb 10, 2023
Messages
107
Office Version
  1. 365
Platform
  1. Windows
Hi Everyone,

I am currently tying to create a MAX Function Formula that will provide me with an output based on two sets of criteria. In this specific example, I am trying to return the Category associated with a Brand and the Revenue. However, I would like to pull the category in which the Brand has the most revenue occurring. So in this Example, because the Brand OneUP has the most revenue occurring in the Kitchen Category, I would like to return "Kitchen" as the Category. If someone could please provide me some assistance, that would be greatly appreciated. Thank You!

1687266464867.png
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
would you be kind enough to help the forum help you?
Please use the xl2bb add in to post a mini worksheet, or at minimum post a table of the data?

Thanks in advance.
 
Upvote 0
But try this:

Book1
ABCDEFG
1CategorybrandrevenueBrandCATEGORY
2HealthOneUP2OneUPKitchenKitchen
3HealthYez5YezBeautyBeauty
4HealthHowd7HowdHealthHealth
5HealthNUE10NUEKitchenKitchen
6HealthHOS3HOSBeautyBeauty
7KitchenOneUP150
8KitchenYez0
9KitchenHowd0
10KitchenNUE35
11KitchenHOS0
12BeautyOneUP20
13BeautyYez350
14BeautyHowd0
15BeautyNUE0
16BeautyHOS700
acool
Cell Formulas
RangeFormula
G2:G6G2=INDEX(A2:A16,MATCH(MAX(CHOOSECOLS(FILTER(A2:C16,(B2:B16=E2)),1,3)),C2:C16,0))
 
Upvote 0
But try this:

Book1
ABCDEFG
1CategorybrandrevenueBrandCATEGORY
2HealthOneUP2OneUPKitchenKitchen
3HealthYez5YezBeautyBeauty
4HealthHowd7HowdHealthHealth
5HealthNUE10NUEKitchenKitchen
6HealthHOS3HOSBeautyBeauty
7KitchenOneUP150
8KitchenYez0
9KitchenHowd0
10KitchenNUE35
11KitchenHOS0
12BeautyOneUP20
13BeautyYez350
14BeautyHowd0
15BeautyNUE0
16BeautyHOS700
acool
Cell Formulas
RangeFormula
G2:G6G2=INDEX(A2:A16,MATCH(MAX(CHOOSECOLS(FILTER(A2:C16,(B2:B16=E2)),1,3)),C2:C16,0))

Obviously you can see I changed your data layout from a report into a flat file type layout.
 
Upvote 0
But try this:

Book1
ABCDEFG
1CategorybrandrevenueBrandCATEGORY
2HealthOneUP2OneUPKitchenKitchen
3HealthYez5YezBeautyBeauty
4HealthHowd7HowdHealthHealth
5HealthNUE10NUEKitchenKitchen
6HealthHOS3HOSBeautyBeauty
7KitchenOneUP150
8KitchenYez0
9KitchenHowd0
10KitchenNUE35
11KitchenHOS0
12BeautyOneUP20
13BeautyYez350
14BeautyHowd0
15BeautyNUE0
16BeautyHOS700
acool
Cell Formulas
RangeFormula
G2:G6G2=INDEX(A2:A16,MATCH(MAX(CHOOSECOLS(FILTER(A2:C16,(B2:B16=E2)),1,3)),C2:C16,0))
This Worked thank you!
 
Upvote 0
But try this:

Book1
ABCDEFG
1CategorybrandrevenueBrandCATEGORY
2HealthOneUP2OneUPKitchenKitchen
3HealthYez5YezBeautyBeauty
4HealthHowd7HowdHealthHealth
5HealthNUE10NUEKitchenKitchen
6HealthHOS3HOSBeautyBeauty
7KitchenOneUP150
8KitchenYez0
9KitchenHowd0
10KitchenNUE35
11KitchenHOS0
12BeautyOneUP20
13BeautyYez350
14BeautyHowd0
15BeautyNUE0
16BeautyHOS700
acool
Cell Formulas
RangeFormula
G2:G6G2=INDEX(A2:A16,MATCH(MAX(CHOOSECOLS(FILTER(A2:C16,(B2:B16=E2)),1,3)),C2:C16,0))
@awoohaw This Worked! However, I wanted to see if you knew a fix for this issue below. I added another category + plus one other brand with a value of zero for each. As I went to do the Index max on this new Brand "Yeez", it is providing me with the wrong value. Instead of "Cars, it is providing me with kitchen". Yeez is not even a value for the Kitchen Category. Was wondering if you knew why this was? Thanks for all of your help so far!

1687467159750.png
 
Upvote 0
How about
Excel Formula:
=TAKE(SORT(FILTER($A$2:$C$100,$B$2:$B$100=E2),3,-1),1,1)
 
Upvote 0
Solution

Forum statistics

Threads
1,215,194
Messages
6,123,569
Members
449,108
Latest member
rache47

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top