Spire.XLS is a professional Excel API that enables developers to create, manage, manipulate, convert and print Excel worksheets. Get free and professional technical support for Spire.XLS for .NET, Java, Android, C++, Python.

Wed May 28, 2025 1:25 pm

Hello,

i am facing the following issue: When trying to apply a conditional formula with "AGGREGATE" on a worksheet, it does not seem to have an effect in Excel. If i inspect the formula in Excel, it is there but has no effect. Also can you confirm, that i always have to use the english formula in the code? My local system and Excel is german.
The task is to colorize the background with the AGGREGATE formula. I managed to apply a formula with MOD and ROW, but not with AGGREGATE

var range = _worksheet.Range[2, 1, _worksheet.LastRow, _worksheet.LastColumn];
var conditionalFormats = _worksheet.ConditionalFormats.Add();

conditionalFormats.AddRange(range);

var condition = conditionalFormats.AddCondition();
condition.FormatType = ConditionalFormatType.Formula;
//condition.FirstFormula = "=MOD(ROW(),2)=0"; <= This one works
condition.FirstFormula = "=AGGREGATE(3,5,A$2:A2)>=3";
condition.BackColor = Color.FromArgb(255, 220, 230, 241);

Thank You and kind regards

svg_awojnar
 
Posts: 1
Joined: Wed May 28, 2025 1:05 pm

Thu May 29, 2025 11:20 am

Hello,

Thanks for your inquiry.
I have reproduced the issue you mentioned and logged it to our tracking system with the ticket SPIREXLS-5833. Our development team will further investigate and fix it. Once there is any progress, we will inform you in time. Sorry for the inconvenience caused to you.

Sincerely,
Tommy
E-iceblue support team
User avatar

Tommy.Tang
 
Posts: 85
Joined: Mon Apr 21, 2025 7:05 am

Fri Jul 18, 2025 6:33 am

Hi,

Glad to inform you that the reported bug SPIREXLS-5833 has been resolved and the new version ( Spire.XLS Pack(Hotfix) Version:15.7.8 ) is available. Please download it from the following link.
Website download link: https://www.e-iceblue.com/Download/download-excel-for-net-now.html
Nuget download link:https://www.nuget.org/packages/Spire.XLS/15.7.8
https://www.nuget.org/packages/Spire.XLSfor.NETStandard/15.7.8

Sincerely,
Nina
E-iceblue support team
User avatar

Nina.Tang
 
Posts: 1377
Joined: Tue Sep 27, 2016 1:06 am

Return to Spire.XLS