Find Max of Year

Pestomania

Active Member
Joined
May 30, 2018
Messages
332
Office Version
  1. 365
Platform
  1. Windows
Hello,

I am trying to find the "max" per year. I have this formula, but it returns value of 1 even when the max is 0 and doesn't define the year appropriately. This formula works when it is "sumproduct" but not when it is max.. It does return the appropriate number whenever there is a value greater than 0 in the selection.

Excel Formula:
=MAX($G$15:$AP$15,--(YEAR($G$14:$AP$14)=G$10))

10 Year Capacity Planning Model Rev 20240321 - Full_Morin_Densification.xlsm
FGHIJKLMNOPQRSTUVWXYZAAABACADAEAFAGAHAIAJAKALAMANAOAP
10202320242025
11Max393939
12Sum123788
13
141/1/20232/1/20233/1/20234/1/20235/1/20236/1/20237/1/20238/1/20239/1/202310/1/202311/1/202312/1/20231/1/20242/1/20243/1/20244/1/20245/1/20246/1/20247/1/20248/1/20249/1/202410/1/202411/1/202412/1/20241/1/20252/1/20253/1/20254/1/20255/1/20256/1/20257/1/20258/1/20259/1/202510/1/202511/1/202512/1/2025
15200100000000040060000012150003901403500000
Proposed Equipment Add
Cell Formulas
RangeFormula
G11:I11G11=MAX($G$15:$AP$15,--(YEAR($G$14:$AP$14)=G$10))
G12:I12G12=SUMPRODUCT($G$15:$AP$15,--(YEAR($G$14:$AP$14)=G$10))
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
Try this:
Excel Formula:
=MAX($G$15:$AP$15*(YEAR($G$14:$AP$14)=G$10))
 
Upvote 0
How about
Excel Formula:
=MAX(FILTER($G$15:$AP$15,YEAR($G$14:$AP$14)=G$10))
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0
Glad we could help & thanks for the feedback.
I added an indirect (which works when not in a table) but breaks once it is in a table, any thoughts?

Excel Formula:
=MAX(FILTER(INDIRECT("Morin_"&$A5&"_Equipment_Proposed"),YEAR(Capacity_Charts_Date_Range)=C$1))-SUM($B5:B5)
 
Upvote 0
In what way doesn't it work?
I receive a "#Calc" error stating the error is "Empty Array".

I apologize but can't show the entire table:

1711468218344.png
 
Upvote 0
That suggests that there is nothing matching the criteria.
 
Upvote 0
That suggests that there is nothing matching the criteria.
How would that be if it works whenever it is outside of a table?

It provides results whenever not in a table:
1711468547158.png


But as soon as I turn that range into a table, it stops working. I can work with it and just work on different methods, but tables look nice.
 
Upvote 0

Forum statistics

Threads
1,224,815
Messages
6,181,136
Members
453,021
Latest member
Justyna P

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