PHPExcel Sum与跳过的列 [英] PHPExcel Sum with skipped columns

查看:101
本文介绍了PHPExcel Sum与跳过的列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只想问一下如何水平汇总列,每隔一列跳过一次? 这是屏幕截图.

I just want to ask how can I sum columns horizontaly, skipping every 1 column? Here's the screenshot.

我只想对D9和F9求和,只是分支代码.我想忽略列"r"的含义. 请注意,列数是动态的,有可能 有6个分支,也有6个分支.它们的值将在同一行上,如何通过仅在分支下添加这些值来对其进行排序?结果应该在净销售额之下.

I just want to sum D9 and F9 only whic is the Branch Code. I want to disregard the column "r" which means rank. Please take note that the number of columns is dynamic, there are possibilities that that there are 6 Branches with also 6 branch. Their values will be on the same row, how can I sort it out, by adding only those values under branches? Result should be under the net sales.

谢谢大家!

推荐答案

如果第8行中的列标题"始终是您要跳过的列的"r",则可以使用以下Excel公式:

If the "column heading" in row 8 is always an "r" for the columns you want skip, you can use an Excel formula of:

=SUMIF(C8:H8,"<>r",C9:H9)

对范围C8:H8中的值不等于"r"的每一列求和,得出范围C9:H9中的值

to sum the values in range C9:H9 for each column where the value in range C8:H8 is not equal to the value "r"

这篇关于PHPExcel Sum与跳过的列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆