跳到主要內容

如何基於Excel中另一列中的條件求和值?

有時您想基於另一列中的條件求和,例如,在這裡我只想總結“銷售量”列,其中相應的“產品”列等於“ A”,如下所示,您該怎麼做它? 當然,您可以將它們一一求和,但是在這裡,我介紹了一些簡單的方法供您對Excel中的值求和。

在Excel中具有公式的基於另一列中條件的求和值

基於Excel中數據透視表的另一列中的條件的值求和

使用Kutools for Excel在另一列中基於條件求和的值

按條件列將數據拆分到新表中,然後求和


在Excel中具有公式的基於另一列中條件的求和值

在Excel中,您可以使用公式根據相鄰列中的某些條件快速求和值。

1.複製將基於其進行匯總的列,然後粘貼到另一列中。 在我們的例子中,我們複製了Fruit列並粘貼到E列中。請參見左側的屏幕截圖。

2.保持選中粘貼列,單擊 數據 > 刪除重複項。 然後在彈出的“刪除重複項”對話框中,僅檢查粘貼的列,然後單擊 OK 按鈕。

3.現在,僅唯一值保留在粘貼列中。 除了粘貼的列,選擇一個空白單元格,鍵入公式 =SUMIF($A$2:$A$24, D2, $B$2:$B$24) 放入其中,然後根據需要將其“自動填充句柄”向下拖動。

然後我們根據指定的列進行求和。 看截圖:

備註:在上面的公式中,A2:A24是您要基於其值求和的列,D2是粘貼的列中的一個值,而B2:B24是要求和的列。

根據Excel中另一列中的條件輕鬆求和/計數/平均值

Kutools for Excel的 高級合併行 實用程序可以幫助Excel用戶根據另一列中的條件輕鬆地對一列中的值進行批量求和,計數,平均值,最大值,最小值。


在另一列02中按條件計算的文檔總和

Excel的Kutools - 使用 300 多種基本工具增強 Excel 功能。 享受全功能 30 天免費試用,無需信用卡! 立即行動吧!

基於Excel中數據透視表的另一列中的條件的值求和

除了使用公式,您還可以通過插入數據透視表在另一列中基於條件求和。

1.選擇所需的範圍,然後單擊 插入 > 數據透視表 or 插入 > 數據透視表 > 數據透視表 打開“創建數據透視表”對話框。

2.在“創建數據透視表”對話框中,指定將新數據透視表放置在的目標範圍,然後單擊 OK 按鈕。

3.然後在 數據透視表字段 窗格中,將條件列名稱拖到 部分,將您要匯總的列拖到 價值觀 部分。 看截圖:

然後,您可以看到上面的數據透視表,它已基於條件列中的每個項目對“金額”列進行了匯總。 參見上面的截圖:


將值求和並根據另一列中的條件與Kutools for Excel合併

有時,您可能需要根據另一列中的條件對值求和,然後將原始數據直接替換為求和值。 您可以將Kutools用於Excel的 高級合併行 效用。

Excel的Kutools - 包含 300 多個 Excel 基本工具。 享受全功能 30 天免費試用,無需信用卡! 現在下載!

1.在另一列中選擇要根據條件求和的值範圍,然後單擊 庫工具 > 內容 > 高級合併行.

請注意,該範圍應同時包含您要基於其匯總的列和您要對其進行匯總的列。

2.在打開的“基於列合併行”對話框中,您需要:
(1)選擇您要基於其進行匯總的列名稱,然後單擊 首要的關鍵 按鈕;
(2)選擇要累加的列名,然後單擊 計算 > 總和.
(3)點擊 Ok 按鈕。

現在,您將看到根據另一列中的條件對指定列中的值進行求和。 參見上面的截圖:

Excel的Kutools - 使用 300 多種基本工具增強 Excel 功能。 享受全功能 30 天免費試用,無需信用卡! 立即行動吧!


演示:使用Kutools for Excel在另一列中基於條件求和


Excel的Kutools:超過 300 個方便的工具觸手可及! 立即開始 30 天免費試用,沒有任何功能限制。 現在就下載!

根據Excel列中的條件輕鬆將範圍分為多個工作表

Kutools for Excel的 拆分數據 實用程序可以幫助Excel用戶根據原始範圍的一列中的條件輕鬆地將範圍分為多個工作表。


廣告分割數據0

Excel的Kutools - 使用 300 多種基本工具增強 Excel 功能。 享受全功能 30 天免費試用,無需信用卡! 立即行動吧!

相關文章:

最佳辦公生產力工具

🤖 Kutools 人工智慧助手:基於以下內容徹底改變數據分析: 智慧執行   |  生成代碼  |  建立自訂公式  |  分析數據並產生圖表  |  呼叫 Kutools 函數...
熱門特色: 尋找、突出顯示或識別重複項   |  刪除空白行   |  合併列或儲存格而不遺失數據   |   沒有公式的回合 ...
超級查詢: 多條件VLookup    多值VLookup  |   跨多個工作表的 VLookup   |   模糊查詢 ....
高級下拉列表: 快速建立下拉列表   |  依賴下拉列表   |  多選下拉列表 ....
欄目經理: 新增特定數量的列  |  移動列  |  切換隱藏列的可見性狀態  |  比較範圍和列 ...
特色功能: 網格焦點   |  設計圖   |   大方程式酒吧    工作簿和工作表管理器   |  資源庫 (自動文字)   |  日期選擇器   |  合併工作表   |  加密/解密單元格    按清單發送電子郵件   |  超級濾鏡   |   特殊過濾器 (過濾粗體/斜體/刪除線...)...
前 15 個工具集12 文本 工具 (添加文本, 刪除字符,...)   |   50+ 圖表 類型 (甘特圖,...)   |   40+ 實用 公式 (根據生日計算年齡,...)   |   19 插入 工具 (插入二維碼, 從路徑插入圖片,...)   |   12 轉化 工具 (數字到單詞, 貨幣兌換,...)   |   7 合併與拆分 工具 (高級合併行, 分裂細胞,...)   |   ... 和更多

使用 Kutools for Excel 增強您的 Excel 技能,體驗前所未有的效率。 Kutools for Excel 提供了 300 多種進階功能來提高生產力並節省時間。  點擊此處獲取您最需要的功能...

產品描述


Office選項卡為Office帶來了選項卡式界面,使您的工作更加輕鬆

  • 在Word,Excel,PowerPoint中啟用選項卡式編輯和閱讀,發布者,Access,Visio和Project。
  • 在同一窗口的新選項卡中而不是在新窗口中打開並創建多個文檔。
  • 將您的工作效率提高 50%,每天為您減少數百次鼠標點擊!
Comments (16)
Rated 5 out of 5 · 1 ratings
This comment was minimized by the moderator on the site
i need one excel sheet column total value automatically to another excel sheet to generate repot.
This comment was minimized by the moderator on the site
You are amazing!!

Thanks for this!
Rated 5 out of 5
This comment was minimized by the moderator on the site
In the latest Excel, you need to use ; instead of , as the separator for the arguments, so '=SUMIF($A$2:A15; D2; $B$2:$B$15)' is the correct syntax in the first example.  
This comment was minimized by the moderator on the site
Hi,I want to sum a range of numbers in a column, which will start with a particular text in another column and till a particular text in same text column. Please help
This comment was minimized by the moderator on the site
I have two Columns A & B. A is a numeric value as well as B. I want to: If A equals (say 4) or more, then count B. I want the sum count of all B's added.
ex:
A. B. 1 54 76 103 9
Sum: 17
Any help? I imagine it is some sort of countif function - has been a while for me.
Thanks!
This comment was minimized by the moderator on the site
Hi,=SUMIF(A1:A4,">="&4,B1:B4)
This comment was minimized by the moderator on the site
wow, thank you so much, i learnt a new thing from ua article, it helped me a lot & saved lot of my time
This comment was minimized by the moderator on the site
if two coulumn have same fruit then add them like this
apple orange grapes apple
2 4 5 7
5 4 3 23
21 3 34 22

then i would like to add total no. of apples
can this be done by any formula or some tricks
This comment was minimized by the moderator on the site
Hi Surat,
What about adding the total number manually?
Holding the SHIFT key, select both Apple columns simultaneously, and then you will get the total number in the status bar.
This comment was minimized by the moderator on the site
Hi. I have two types of Payments in cell G5:G51 ("Security" and "Rental"). The amount is in cell H5:H51. I wan to sum up all the security Payments in Cell K5 and All Rental Payments in Cell K6. How can I do it.
This comment was minimized by the moderator on the site
thanks for the excellent - quick & easy instructions for creating totals based on "distinct" values
This comment was minimized by the moderator on the site
I want sum FABRICS 2014> 16.90 mtr N-15FLAT011W/O STONES(BLUE) 16.90 mtr SP12044-GGT-TL#1255 FNC 2014 > N-MT#28-#4(SILVER) 11.50 mtr N-MT#5-#7(SKY BLUE) 28.90 mtr FPR 2014> M-FML-A478(RED) 6.79 mtr N-PR-#8961-(PINK) 18.30 mtr
There are no comments posted here yet
Load More
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations