WorksheetFunction.HypGeomDist 方法 (Excel)

傳回超幾何分配。 HypGeomDist 會根據樣本大小、母體成功和母體大小,傳回指定樣本成功次數的機率。 針對有限母體的問題使用 HypGeomDist ,其中每個觀察結果都是成功或失敗,而指定大小的每個子集都以相等的可能性選擇。

重要事項

此函式已取代為一或多個新函式,這些函式可提供更佳的精確度,且其名稱更能反映其使用方式。 此函式仍可供與舊版 Excel 相容。 不過,如果不需要回溯相容性,您應該考慮從現在開始使用新的函式,因為它們更精確地描述其功能。

如需新函式的詳細資訊,請 參閱 HypGeom_Dist 方法。

語法

運算式HypGeomDist (Arg1Arg2Arg3Arg4)

表達 代表 WorksheetFunction 物件的 變數。

參數

名稱 必要/選用 資料類型 描述
Arg1 必要 雙精確度 Sample_s - 樣本成功數。
Arg2 必要 雙精確度 Number_sample - 樣本大小。
Arg3 必要 雙精確度 Population_s - 母體成功數。
Arg4 必要 雙精確度 Number_population - 母體大小。

傳回值

雙精確度

註解

會將所有引數無條件捨去成整數。

如果有任何非數值引數, HypGeomDist 會 傳回#VALUE! 錯誤值。

如果 sample_s < 0 或 sample_s 大於小於 number_sample 或 population_s, HypGeomDist 會 傳回#NUM! 錯誤值。

如果 sample_s 小於大於 0 或 (number_sample - number_population + population_s) , HypGeomDist 會傳回#NUM! 錯誤值。

如果 number_sample ≤ 0 或 number_sample > number_population, HypGeomDist 會 傳回#NUM! 錯誤值。

如果 population_s ≤ 0 或 population_s > number_population, HypGeomDist 會 傳回#NUM! 錯誤值。

如果number_population ≤ 0, HypGeomDist 會 傳回#NUM! 錯誤值。

超geometric 分佈的方程式如下所示,其中:

  • x = sample_s
  • n = number_sample
  • M = population_s
  • N = number_population

公式

HypGeomDist 用於取樣,而不會取代有限的母體擴展。

支援和意見反應

有關於 Office VBA 或這份文件的問題或意見反應嗎? 如需取得支援服務並提供意見反應的相關指導,請參閱 Office VBA 支援與意見反應