简体   繁体   English

Excel 计数文本前的单元格

[英]Excel Count Cells before text

I have a holiday sheet and wish to add up the number of hours for each holiday type, so for example我有一张假期表,希望将每种假期类型的小时数相加,例如

A一种 B C C D E F F G G H H I J
E L大号 N Type类型 Name名称 E L大号 N Type类型 Name名称
8 8个 Holiday假期 J Blogs J 博客 8 8个 - - - - Lieu H Potter波特

I would like to count across the row for each holiday type ie holiday, lieu, unpaid then i want to count the hours in the 3 cells before each holiday type for the holiday month.我想计算每个假期类型的行数,即假期、假期、无薪然后我想计算假期月份每个假期类型之前 3 个单元格中的小时数。

i should then end up with something along the lines of然后我应该得到一些类似的东西

Holiday假期 Lieu Unpaid未付
32 32 8 8个 16 16

This would be for around 400 people each row is for one person.这将适用于大约 400 人,每行仅供一个人使用。

Thanks谢谢

Try SUMPRODUCT() .尝试SUMPRODUCT()

=SUMPRODUCT(IFERROR(--($D$2:$AN$2=E5)*($A$2:$AL$2),0))

在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM