简体   繁体   English

我需要帮助找到一个公式来格式化我的 Excel 数据库

[英]I need help finding a formula to format my Excel database

图片

Excel doesn't count my records like I want it to. Excel 不会像我希望的那样计算我的记录。 I have been trying for a while now.我已经尝试了一段时间了。

Example例子

School        6
Work          5
TV            3
School        2

I have a formula that counts the numbers, so I have a total now.我有一个计算数字的公式,所以我现在有一个总数。 which is 16. What I want is to have a formula that counts the hours for each term这是 16. 我想要的是有一个计算每个学期小时数的公式

So when I write所以当我写

School
Tv 
Work

I want to get the hours for each of these.我想获得每一个的小时数。

So instead of counting the number of "school" that is in the document, I want it to calculate ALL numbers even if school is in there like 10 times.因此,与其计算文档中“学校”的数量,我希望它计算所有数字,即使学校在那里 10 次。

In this case my expected output would be在这种情况下,我的预期输出将是

School 8
TV     3
Work   5 

I've been searching for the formula to do this...我一直在寻找公式来做到这一点......

So I'll try to explain again: I have 2 fields, one containing terms the other containing numbers.所以我将再次尝试解释:我有 2 个字段,一个包含术语,另一个包含数字。 I need a formula that counts the sum of numbers for each term in the fields with terms.我需要一个公式来计算带有术语的字段中每个术语的数字总和。 EVEN IF the term is in there twice than it is supposed to count the values and add it up to each other... By doing this I will be able to create a graphic.即使该术语在那里出现两倍于它应该计算的值并将其相加......通过这样做,我将能够创建一个图形。

UPDATE更新

Maybe the picture will help understanding it better也许图片会有助于更好地理解它

You don't want to count, you want to sum.你不想数,你想求和。 Assuming the text in your screenshot "FORMULA HERE" is in cell K3, you can use假设屏幕截图“FORMULA HERE”中的文本位于单元格 K3 中,您可以使用

=Sumifs(B:B,C:C,J3)

in words: Sum all values from column B where the text in column C is the same as the text in J3. in words:汇总 B 列中的所有值,其中 C 列中的文本与 J3 中的文本相同。 Adjust the column and cell references to suit your scenario.调整列和单元格引用以适合您的方案。

Copy the formula down.把公式复制下来。

Analysis like this can also be done with pivot tables, without having to write any formulas.像这样的分析也可以使用数据透视表完成,而无需编写任何公式。

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

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