[英]Excel - How to locate and sum adjacent cells and over multiple columns based on criteria of other columns cells
[英]Sum numbers if multiple criteria is met in other cells
我有一個 Excel 電子表格,其中的數據如下所示:
Column A Column B Column C Column D
Row 1 Sector Rail
Row 2 A B C
Row 3 Type 1 1 5 1
Row 4 Type 2 2 3 0
Row 5 Type 3 1 1 6
Row 6 Total 4 9 7
在第 1 行中,您可以看到 AI 列中有扇區,而 BI 列中有扇區類型,即Rail
。 我的電子表格按照這種結構出現了多次不同的數據,如下所示:
Column A Column B Column C Column D
Row 1 Sector Rail
Row 2 A B C
Row 3 Type 1 1 5 1
Row 4 Type 2 2 3 0
Row 5 Type 3 1 1 6
Row 6 Total 4 9 7
Row 7
Row 8 Sector aerospace
Row 9 A B C
Row 10 Type 1 0 9 9
Row 11 Type 2 3 3 1
Row 12 Type 3 4 5 6
Row 13 Total 0 1 8
Row 14
Row 15 Sector Rail
Row 16 A B C
Row 17 Type 1 8 9 9
Row 18 Type 2 3 3 1
Row 19 Type 3 4 5 6
Row 20 Total 9 1 8
需要注意的是有兩套與行業數據的Rail
和一個與Aerospace
在中間。
現在我需要一個公式來添加 B 列第 6 行中的總數並添加 b 列第 20 行中的總數。但僅適用於Rail
。
所以 B 列第 1 行有一個扇區Rail
,但 B 列第 14 行也是如此。 所以我需要一個公式來找到單詞Rail
兩個出現,然后給我第 6 行 + 第 20 行的總數,這將是 1 + 8 = 總共 9
誰能告訴我這是否可能?
請嘗試刪除 Row2 並:
=SUMIF(B1:B98,"Rail",B2:B99)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.