Aggregate Max function not working correctly

honkin

Active Member
Joined
Mar 20, 2012
Messages
374
Office Version
  1. 2016
Platform
  1. MacOS
I have a sheet which keeps a tally of profit, drawdown and the like and I am trying to do a simple calculation, but the answer seems way off.

In column CU, drawdown % is calculated. At present there are only 59,200 rows and row 22 is the first row of data.

This is the formula to work out the maximum drawdown. It is really just taking a maximum of the column

=AGGREGATE(4,5,$CU$22:CU300000)

The response showing is 1724.57%, yet when I examine the CU column, the largest number in there is only 711.71%. How is it possible that the Max function of Aggregate can get this so wrong? Even if I change the formula to reflect just to the last current row of data, 59200, the answer is the same and wrong.

The formula in CU is a simple one to calculate the drawdown % from the drawdown $ amount in CT and the peak $ amount in CS

=IF(CT22<>"",-CT23/CS23,"")

Here is a sample

2022 Latest Results.xlsb
CRCSCTCU
20DRAWDOWN - WIN
21Total Win EquityPeak Win Equity Drawdown Drawdown %
2211,372.9811,372.98$ -0.00%
2311,272.9811,372.98$ (100.00)0.88%
2411,172.9811,372.98$ (200.00)1.76%
2511,072.9811,372.98$ (300.00)2.64%
2610,972.9811,372.98$ (400.00)3.52%
2710,872.9811,372.98$ (500.00)4.40%
2810,772.9811,372.98$ (600.00)5.28%
2910,672.9811,372.98$ (700.00)6.15%
3010,572.9811,372.98$ (800.00)7.03%
3110,472.9811,372.98$ (900.00)7.91%
3210,372.9811,372.98$ (1,000.00)8.79%
3310,272.9811,372.98$ (1,100.00)9.67%
3410,305.3211,372.98$ (1,067.66)9.39%
3510,205.3211,372.98$ (1,167.66)10.27%
3610,105.3211,372.98$ (1,267.66)11.15%
3710,005.3211,372.98$ (1,367.66)12.03%
389,905.3211,372.98$ (1,467.66)12.90%
399,805.3211,372.98$ (1,567.66)13.78%
409,705.3211,372.98$ (1,667.66)14.66%
419,605.3211,372.98$ (1,767.66)15.54%
429,505.3211,372.98$ (1,867.66)16.42%
439,405.3211,372.98$ (1,967.66)17.30%
449,305.3211,372.98$ (2,067.66)18.18%
459,205.3211,372.98$ (2,167.66)19.06%
469,105.3211,372.98$ (2,267.66)19.94%
479,005.3211,372.98$ (2,367.66)20.82%
488,905.3211,372.98$ (2,467.66)21.70%
499,199.3211,372.98$ (2,173.66)19.11%
509,099.3211,372.98$ (2,273.66)19.99%
518,999.3211,372.98$ (2,373.66)20.87%
528,899.3211,372.98$ (2,473.66)21.75%
538,799.3211,372.98$ (2,573.66)22.63%
548,699.3211,372.98$ (2,673.66)23.51%
558,599.3211,372.98$ (2,773.66)24.39%
568,657.1411,372.98$ (2,715.84)23.88%
578,557.1411,372.98$ (2,815.84)24.76%
588,457.1411,372.98$ (2,915.84)25.64%
598,357.1411,372.98$ (3,015.84)26.52%
608,257.1411,372.98$ (3,115.84)27.40%
618,157.1411,372.98$ (3,215.84)28.28%
628,057.1411,372.98$ (3,315.84)29.16%
637,957.1411,372.98$ (3,415.84)30.03%
647,857.1411,372.98$ (3,515.84)30.91%
658,083.5211,372.98$ (3,289.46)28.92%
667,983.5211,372.98$ (3,389.46)29.80%
677,883.5211,372.98$ (3,489.46)30.68%
687,783.5211,372.98$ (3,589.46)31.56%
697,683.5211,372.98$ (3,689.46)32.44%
707,958.9011,372.98$ (3,414.08)30.02%
717,858.9011,372.98$ (3,514.08)30.90%
727,758.9011,372.98$ (3,614.08)31.78%
737,658.9011,372.98$ (3,714.08)32.66%
747,558.9011,372.98$ (3,814.08)33.54%
757,458.9011,372.98$ (3,914.08)34.42%
767,592.1811,372.98$ (3,780.80)33.24%
777,492.1811,372.98$ (3,880.80)34.12%
787,392.1811,372.98$ (3,980.80)35.00%
rc-vdw-place-adapted-2021-01-01
Cell Formulas
RangeFormula
CR22:CR78CR22=AGGREGATE(9,5,$AD$21:AD22)+$CR$4
CS22:CS78CS22=AGGREGATE(4,5,$CR$21:CR22)
CT22:CT78CT22=CR22-CS22
CU22:CU78CU22=IF(CT22<>"",-CT22/CS22,"")
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
Have you tried to test again with normal MAX function:
=MAX(CU22:CU3000)
Or
=AGGREGATE(14,6,$CU$22:CU300000,1)
?
 
Upvote 0
cheers bebo021999

Both still give the same answer, yet it simply does not exist in that column, so am unsure as to why
 
Upvote 0
yet it simply does not exist in that column,
I suspect that it does.

If you select the whole of column C by clicking its heading label, what shows as Max in the status bar?
1657334240363.png


Try your formula (or selection/status bar method) with cutting the range in half, then quarters, eighths etc to try to track down what row the large result is emanating from.
 
Upvote 0
Solution
I suspect that it does.

If you select the whole of column C by clicking its heading label, what shows as Max in the status bar?
View attachment 68943

Try your formula (or selection/status bar method) with cutting the range in half, then quarters, eighths etc to try to track down what row the large result is emanating from.
Howdy Peter_SSs

Yeah, you ended up being right. To check initially, I was simply clicking the dropdown autofilter arrow on the column. For whatever reason, that only shows up to 711.71. Can say I've experienced it behaving like that before.

So I manually highlighted the start of column CU and went down in chunks until I could see all the entries above 711.71. There are hundreds of them, so not sure why they don't all show.

At least I know the formula is actually working correctly, as it was doing my head in.

cheers
 
Upvote 0
For whatever reason, that only shows up to 711.71. Can say I've experienced it behaving like that before.
You have a large range so the behaviour is most likely related to this:

Limits to AutoFilter Dropdown Lists

In Excel 2003, and earlier versions, an AutoFilter dropdown list will only show 1000 entries. As a result, in a large database, the AutoFilter dropdown may not show all the items in the column. (This limit was raised to 10,000 in Excel 2007.)

Note that although the drop-down list has a limit on how much shows when you click the drop-down, it does not stop you filtering for other values, it is just that you cannot click the other values in that list.
 
Upvote 0

Forum statistics

Threads
1,215,102
Messages
6,123,097
Members
449,096
Latest member
provoking

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