PHPExcel Sum with skipped columns [duplicate]

泄露秘密 提交于 2019-12-12 02:34:34

问题


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

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.

Thanks guys!


回答1:


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)

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"



来源:https://stackoverflow.com/questions/17318598/phpexcel-sum-with-skipped-columns

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!