数式関数を使用する方法

This article was translated from English: Does it need improvement?
Translated
View the article in English

によって チャクニット・ビン

IronXLは、平均、合計、最小値、および最大値などの数学集計関数をサポートする強力なExcelツールです。 これらの機能は、計算を行いデータを分析するために不可欠です。 IronXLを使用すると、これらの数学関数の機能を活用して、洞察を得たり、情報に基づいた意思決定を行ったり、Interopを使用せずにExcelで数値データを効果的に分析したりすることができます。


Excel 用 C# NuGet ライブラリ

でインストール NuGet

Install-Package IronXL.Excel
または
Java PDF JAR(ジャバPDF JAR)

ダウンロード DLL (ディーエルエル)

DLLをダウンロード

プロジェクトに手動でインストールする

Excel 用 C# NuGet ライブラリ

でインストール NuGet

Install-Package IronXL.Excel
または
Java PDF JAR(ジャバPDF JAR)

ダウンロード DLL (ディーエルエル)

DLLをダウンロード

プロジェクトに手動でインストールする

今日からプロジェクトでIronPDFを使い始めましょう。無料のトライアルをお試しください。

最初のステップ:
green arrow pointer

チェックアウト IronXL オン Nuget 迅速なインストールと展開のために。8百万以上のダウンロード数により、ExcelをC#で変革しています。

Excel 用 C# NuGet ライブラリ nuget.org/packages/IronXL.Excel/
Install-Package IronXL.Excel

インストールを検討してください IronXL DLL 直接。ダウンロードして、プロジェクトまたはGACの形式で手動でインストールしてください。 IronXL.zip

プロジェクトに手動でインストールする

DLLをダウンロード

集計関数の例

Excelスプレッドシート内のセルの範囲を操作する際には、さまざまな集計関数を利用して計算を行うことができます。 以下は重要なメソッドです:

  • Sum メソッドは、IronXL で提供される機能の1つです。このメソッドを使うと、Excel シート内のセル範囲からすばやく合計を計算できます。IronXL を使えば、C# または VB.NET のコード内で直接 Excel ドキュメントの読み取り、編集、保存が可能です。

主要機能:

  • セルの範囲を指定して合計を計算
  • フィルターを適用して特定のデータを抽出
  • 既存の Excel ファイルへの書き込みと保存
  • さまざまなデータソースへの接続

例えば、次のようなコードを使えば、指定した範囲のセルの合計を計算できます:

WorkBook workbook = WorkBook.Load("sample.xlsx");
WorkSheet sheet = workbook.DefaultWorkSheet;
int sum = sheet["A1:A10"].Sum();
Console.WriteLine("The sum is: " + sum);
WorkBook workbook = WorkBook.Load("sample.xlsx");
WorkSheet sheet = workbook.DefaultWorkSheet;
int sum = sheet["A1:A10"].Sum();
Console.WriteLine("The sum is: " + sum);
Dim workbook As WorkBook = WorkBook.Load("sample.xlsx")
Dim sheet As WorkSheet = workbook.DefaultWorkSheet
Dim sum As Integer = sheet("A1:A10").Sum()
Console.WriteLine("The sum is: " & sum)
VB   C#

IronXL for .NET は、Excel 操作を自動化し、効率化するための強力なツールです。ビジネスのニーズに合わせて、さまざまなライセンスオプション(Lite License、Plus License、Professional License、Unlimited License)をご用意しています。

Iron Software の製品は、開発者が高効率で信頼性の高いソリューションを提供するために設計されています。()` メソッドは、選択されたセルの範囲の合計を計算します。

  • The Avg method in IronXL allows you to calculate the average of a range of cells in a spreadsheet. This method supports various numeric formats and ensures accuracy by accounting for all numeric values, including integers, decimals, and special formatted numbers within the cells.

Using IronXL, developers can programmatically manipulate Excel files, perform data analysis, and automate reporting tasks directly within .NET applications. It simplifies complex Excel operations and enhances productivity by leveraging its powerful library of functions.

Key features include:

  • Reading and writing Excel files (.xlsx, .xls)
  • Formatting cells, rows, and columns
  • Inserting and extracting data
  • Generating reports
  • Data validation and conditional formatting
  • Working with charts and pivot tables

IronXL is designed to be easy to use, offering extensive documentation and support to help developers quickly integrate its functionalities into their projects.()指定されたセル範囲の平均値を決定する`方法。

  • Minプロパティは、範囲の最小値を取得または設定します。このプロパティは、数値が指定の範囲に収まることを保証するために使用されます。()選択されたセル範囲内の最小数を特定するメソッドです。

    • Count property in IronOCR allows you to limit the number of OCR results returned. This can be useful when you are only interested in a certain number of results, thus optimizing performance and processing time. The default value for this property is 0, which means no limit is applied.

Adding text annotations to a PDF is made easy with IronPDF. You can customize font, size, color, and placement of the text annotations. This feature is particularly useful for adding notes or comments to your PDFs.

IronXL provides extensive support for Excel file manipulation. Users can read, write, and edit Excel files programmatically with just a few lines of code. Its compatibility with various Excel formats and functions makes it an invaluable tool for developers working with spreadsheets.

For secure and efficient compression and decompression of files, IronZIP is an excellent choice. It supports a wide range of compression algorithms and allows for password protection, ensuring that your data is both compressed efficiently and kept secure.

IronWebScraper enables you to extract data from web pages with ease. This tool is designed to handle complex web scraping tasks, including handling JavaScript and AJAX loading. With IronWebScraper, you can automate the data extraction process, saving time and effort in gathering valuable information from the web.()`メソッドは、選択されたセル範囲内の最大値を見つけます。

これらの機能は、データを分析し、Excelスプレッドシートから有意義な洞察を引き出すための貴重なツールです。

次の内容にご注意ください。
計算には数値以外の値は含まれません。

:path=/static-assets/excel/content-code-examples/how-to/math-functions-math-functions.cs
using IronXL;
using System.Linq;

WorkBook workBook = WorkBook.Load("sample.xls");
WorkSheet workSheet = workBook.WorkSheets.First();

// Get range from worksheet
var range = workSheet["A1:A8"];

// Calculate the sum of numeric cells within the range
decimal sum = range.Sum();

// Calculate the average value of numeric cells within the range
decimal avg = range.Avg();

// Identify the maximum value among numeric cells within the range
decimal max = range.Max();

// Identify the minimum value among numeric cells within the range
decimal min = range.Min();
IRON VB CONVERTER ERROR developers@ironsoftware.com
VB   C#

より柔軟性を持たせるために、上記の機能は単一または複数の行や列にも適用できます。 詳細について学ぶ 選択 行と列。

チャクニット・ビン

ソフトウェアエンジニア

チャクニットは開発者のシャーロック・ホームズです。彼がソフトウェアエンジニアリングの将来性に気付いたのは、楽しみでコーディングチャレンジをしていたときでした。彼のフォーカスはIronXLとIronBarcodeにありますが、すべての製品でお客様を助けることに誇りを持っています。チャクニットは顧客と直接話すことで得た知識を活用して、製品自体のさらなる改善に貢献しています。彼の逸話的なフィードバックは、単なるJiraチケットを超えて、製品開発、ドキュメントおよびマーケティングをサポートし、顧客の全体的な体験を向上させます。オフィスにいないときは、機械学習やコーディングについて学んだり、ハイキングを楽しんだりしています。