基于Excel VBA自定义函数的河湖水质与富营养化一体化评价工具
Integrated Evaluation Tool of River-Lake Water Quality and Eutrophication Based on Excel VBA Custom Functions
摘要: 针对水资源质量年报编制过程中,河湖的水质状况、富营养化状态批量评价计算时,采用Excel多层嵌套公式存在逻辑冗长、维护难度大、人工计算误差突出等问题,本文开发一套内嵌国标限值的Excel VBA自定义函数评价工具。工具内置GB 3838-2002、SL 395-2007评价规则,集成单指标水质判定、超标统计、综合营养状态指数TLI计算、水源地达标判别六大函数,可自动区分河流、湖库差异化评价标准。以湖北安陆解放山水库2021年逐月监测数据开展实例验证,从调用复杂度、运算效率、复核难度与传统嵌套公式法对比测试。结果表明:函数单元格调用语句仅10~25字符,百站点批量计算耗时降低70%以上,无需配套标准对照表,计算精度与传统方法完全一致。该轻量化工具可显著减少基层水文人员整编工作量,为水资源质量年报自动化编制提供技术支撑。
Abstract: Aiming at the problems including cumbersome logic, difficult maintenance and prominent manual calculation errors when adopting multi-layer nested Excel formulas for batch calculation of water quality status and eutrophication assessment of rivers and lakes in the compilation of annual water resource quality reports, this paper develops an assessment tool of Excel VBA custom functions embedded with national standard limit values. The tool integrates six core functions including single-index water quality classification, over-standard statistics, comprehensive trophic state index (TLI) calculation and water sources compliance judgment, and automatically distinguishes differentiated evaluation criteria for rivers and lakes with built-in standard values of GB 3838-2002 and SL 395-2007. Monthly monitoring data of Jiefangshan Reservoir in Anlu, Hubei Province in 2021 are adopted for case verification. Comparative tests are conducted between the proposed tool and traditional nested formula method from the dimensions of call complexity, calculation efficiency and review difficulty. The results show that each function call only contains 10~25 characters, and the time consumption of batch calculation for 100 monitoring sites is reduced by more than 70%. No auxiliary comparison table is required, and the calculation accuracy is completely consistent with the traditional method. As a lightweight tool, it can effectively cut down data processing workload for grassroots hydrological departments, and provide technical support for automatic compilation of annual water resource quality reports.
文章引用:伊郎, 肖莹. 基于Excel VBA自定义函数的河湖水质与富营养化一体化评价工具[J]. 水资源研究, 2026, 15(4): 400-407. https://doi.org/10.12677/jwrr.2026.154043

参考文献

[1] 嵇晓燕, 杨凯, 李文攀, 等. 国家地表水环境质量评价、分析与表征系统初步构建[J]. 中国环境监测, 2022, 38(5): 38-46.
[2] 赵彦伟, 沈大军. 美国流域生态健康评价体系的发展和实践[J]. 应用生态学报, 2013, 24(7): 2063-2070.
[3] 宁阳明, 尹发能, 李香波. 几种水质评价方法在长江干流中的应用[J]. 西南大学学报(自然科学版), 2020, 42(12): 126-133.
[4] 周怀东, 彭文启, 杜霞, 等. 中国地表水水质评价[J]. 中国水利水电科学研究院学报, 2004, 2(4): 255-264.
[5] 李杰. Excel在水资源质量年报编制中的应用分析[J]. 水资源研究, 2024, 13(10): 892-900.
[6] 廖凯, 戈晓斌, 龙彪, 等. 基于VBA的水质单因子评价程序设计[J]. 电脑编程技巧与维护, 2025, 27(9): 29-31, 42.
[7] 国家环境保护总局, 国家质量监督检验检疫总局. GB 3838-2002. 地表水环境质量标准[S]. 北京: 中国标准出版社, 2002.
[8] 中华人民共和国水利部. SL 395-2007 地表水资源质量评价技术规程[S]. 北京: 中国水利水电出版社, 2007.
[9] 舒金华. 我国湖泊富营养化程度评价方法的探讨[J]. 环境污染与防治, 1990, 12(5): 2-7.
[10] 韩小良. Excel VBA应用开发技巧精华版[M]. 北京: 电子工业出版社, 2007.
[11] 陈美军, 陈非洲. 南京市小型水库水质评价和富营养化分析[J]. 环境保护科学, 2020, 46(4): 86-91.
[12] 张劲松, 王欢, 刘阳, 孙亚敏, 等. 2014-2023年巢湖流域河湖系统总磷浓度时空变化特征分析[J]. 环境监控与预警, 2025, 17(2): 105-111.
[13] 白爱民. 实现地表水环境质量评价的一种方法——使用EXCEL自定义函数的新思路[J]. 环境科学导刊, 2014, 33(4): 72-76.
[14] 聂慧君, 蔡颖, 朱晓晓, 等. 基于Python的数据分析在水环境评价中的应用[J]. 绿色科技, 2024, 26(20): 140-147.