Find maximum value from range based on (complex) criteria

b_raj_kumar

New Member
Joined
May 3, 2022
Messages
6
Office Version
  1. 365
Platform
  1. Windows
Hi

I want to find Maximum value from range using "MAXIFS" (max_Range: B column , Criteria Range- A column, Criteria : A2). In that range, Current category sale value should not consider.

Logic : Calculated Column C2 = B2 cell should not consider in max_range B2:B15 (that means, Maximum value should between (B3:B15) & Criteria range: A2:A15 , Criteria A2)
C3 = B3 cell should not consider in max_range B2:B15 (that means, Maximum value should between (B2,B4:B15) & Criteria range: A2:A15 , Criteria A2)
....
....
....
C15 = B15 cell should not consider in max_range B2:B15 (that means, Maximum value should between (B2:B14) & Criteria range: A2:A15 , Criteria A2)

Could anyone please help me out? Thank you in advance.

Regards
Raj Kumar
 

Attachments

  • Screenshot (310).png
    Screenshot (310).png
    10 KB · Views: 7

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
Hi

I want to find Maximum value from range using "MAXIFS" (max_Range: B column , Criteria Range- A column, Criteria : A2). In that range, Current category sale value should not consider.

Logic : Calculated Column C2 = B2 cell should not consider in max_range B2:B15 (that means, Maximum value should between (B3:B15) & Criteria range: A2:A15 , Criteria : A2)
C3 = B3 cell should not consider in max_range B2:B15 (that means, Maximum value should between (B2,B4:B15) & Criteria range: A2:A15 , Criteria : A3)
....
....
....
C15 = B15 cell should not consider in max_range B2:B15 (that means, Maximum value should between (B2:B14) & Criteria range: A2:A15 , Criteria : A15)

Could anyone please help me out? Thank you in advance.

Note : I slightly edited above thread. As there is no edit option , i again posted in reply

Regards
Raj Kumar
 

Attachments

  • Screenshot (310).png
    Screenshot (310).png
    10 KB · Views: 6
Upvote 0
Hi Marcelo Branco

Thank you so much for reply. The solution is perfect.
I have one more doubt. I modified your formula to SUM. but it giving error. Can you please check?

SUM = AGGREGATE(9,6,$B$3:$B$15/(($A$3:$A$15=A3)*(ROW(A3:A15)<>ROW(A3))))

Regards
Raj Kumar
 
Upvote 0
I don't understand what you are trying to do.
The suggested formula gives the desired results. Why change it?
Why change the first parameter of the AGGREGATE function to 9 (SUM)? What do you want to add?

M.
 
Upvote 0
For the original question, here is another way since you have MS 365.

22 06 16.xlsm
ABC
1
2A52004500
3A23005200
4A45005200
5A17005200
6B26009200
7B40009200
8B40009200
9B92004000
10B18009200
11C13008300
12C34008300
13C53008300
14C83005300
Max
Cell Formulas
RangeFormula
C2:C14C2=LET(f,FILTER(B$2:B$14,A$2:A$14=A2),LARGE(f,1+(MAX(f)=B2)))
 
Upvote 0
I don't understand what you are trying to do.
The suggested formula gives the desired results. Why change it?
Why change the first parameter of the AGGREGATE function to 9 (SUM)? What do you want to add?

M.
HI Marcelo Branco ,
Your solution on "finding Maximum value" is perfect. There is another calculated column for SUM in actual summary. So, I tried to modify your solution in order to find Sum. But, the SUM formula returns #ERROR.
 
Upvote 0
There is another calculated column for SUM in actual summary. So, I tried to modify your solution in order to find Sum. But, the SUM formula returns #ERROR.

Could you, please, provide data along with expected results for this new column?

M.
 
Upvote 0
Could you, please, provide data along with expected results for this new column?

M.
Hi Marcelo Branco,


Please find the new scenario.

Logic : Calculated Column C3 = B3 cell should not consider in sum_range B3:B15 (that means, sum range should between (B4:B15) & Criteria range: A2:A15 , Criteria A3)
C4 = B4 cell should not consider in sum_range B3:B15 (that means, sum_range should between (B3,B5:B15) & Criteria range: A2:A15 , Criteria A4)
....
....
....
C15 = B15 cell should not consider in sum_range B3:B15 (that means, sum_range should between (B3:B14) & Criteria range: A2:A15 , Criteria A15)
 

Attachments

  • Screenshot (317).png
    Screenshot (317).png
    13.3 KB · Views: 6
Upvote 0
Upvote 0
Solution

Forum statistics

Threads
1,215,697
Messages
6,126,269
Members
449,308
Latest member
VerifiedBleachersAttendee

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