跳到主要內容

如何在Excel中僅對正數或負數進行計數/求和?

通常,對我們來說,對工作表中的一系列數據求和或計數很容易,但是在這裡,我只想對正數或負數進行計數或求和。 有沒有解決此問題的有效方法?

用公式僅計算範圍內的正數或負數

僅對公式範圍內的正數或負數求和


用公式僅計算範圍內的正數或負數

在這裡,COUNTIF函數可以幫助您快速計算一個範圍內有多少個正數或負數。

1。 要僅計算正值,請在空白單元格中輸入此公式 = COUNTIF($ A $ 1:$ D $ 7,“> 0”) 進去,看截圖:

文檔計數陽性1

2。 然後按 Enter 鍵,所有正數都已計數,結果顯示在單元格中。 看截圖:

文檔計數陽性1

筆記:

1.如果您只想計算負值的數量,請應用此公式 = COUNTIF($ A $ 1:$ D $ 7,“ <0”).

2.在上面的公式中 A1:D7 是您要使用的數據范圍。


僅對公式範圍內的正數或負數求和

在Excel中,SUMIF函數可以幫助您僅累加正值或負值。 您可以按以下方式應用此公式:

1。 輸入此公式 = SUMIF($ A $ 1:$ D $ 7,“> 0”) 放入空白單元格,請參見屏幕截圖:

文檔計數陽性1

2。 然後按 Enter 鍵,並且僅將所有正數加起來。

文檔計數陽性1

筆記:

1.要僅對一個範圍內的所有負數求和,請使用此公式 = SUMIF($ A $ 1:$ D $ 7,“ <0”).

2.在上式中 A1:D7 是您要使用的數據范圍。


相關文章:

如何在Excel中的一系列單元格中求和/計數粗體數字?

如何計算Excel中錯誤單元/非錯誤單元的數量?

最佳辦公生產力工具

🤖 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 (15)
Rated 5 out of 5 · 1 ratings
This comment was minimized by the moderator on the site
=SUMIF($H$9:$H$39;">0") el carácter es ; no ,
This comment was minimized by the moderator on the site
Hello Sir, i need a solution/Formula to count negative numbers from different cells e.g i have three column of deposit (Current Account, Saving Account and Total Deposit) in 12 months and count in how many many months one branch miss the Current, saving and total budget. but when i use =countifs(C1,E1,F1.....,",0") but it only accept range not selected cell what will be the solution. thanks

e.g
This comment was minimized by the moderator on the site
Hello, i need a solution/Formula to count negative numbers from different cells e.g i have three column of deposit (Current Account, Saving Account and Total Deposit) in 12 months and count in how many many months one branch miss the Current, saving and total budget. but when i use =countifs(C1,E1,F1.....,",0") but it only accept range not selected cell what will be the solution. thanks
This comment was minimized by the moderator on the site
Gracias!! por fortuna escontre está página donde encontré Soluciones. 👍
Rated 5 out of 5
This comment was minimized by the moderator on the site
Bonjour à tous,

je suis novice en excel. Existe il une fonction qui calcule automatiquement la différence entre deux nombres en incluant soit - où + devant le résultat.:
exemple, 1735-1685 = +50. (je l'ai fait avec la fonction somme automatique, mais je n'ai pas le + devant le résultat.
Pouvez vous m'envoyer un exemple de la formule avec ces nombres
Cdlt
This comment was minimized by the moderator on the site
Hello, LYS
Normally, there isn't a function to sove your problem, but, you can apply the SUM function to get the results first, and then use the Format Cells feature to set +0;-0;0 for the numbers, please see the below screenshot:
https://www.extendoffice.com/images/stories/comments/comment-skyyang/doc-format-cells.png

Please have a try, hope it can help you!
This comment was minimized by the moderator on the site
Thank you!!! This worked like a charm for my bank's annoying single "amount" column.
This comment was minimized by the moderator on the site
Thanks a lot!
This comment was minimized by the moderator on the site
How to use the Countif formula to count Positive AND Negative values but exclude ZEROS from the counting?

For example (data below):
1
3
0
-5
0
-1
7

The Total counting that I am expecting is equal to 5.

I thought the formula should be like =COUNTIF(N18:N320,"<>0")
But it is not working in the way that I imagined.
Can anyone help please?

Thanks,
Fernando
This comment was minimized by the moderator on the site
@Ferras,


=(COUNTIF(N18:N320,">0")+COUNTIF(N18:N320,"<0"))

Try it and let me know.
This comment was minimized by the moderator on the site
=COUNTIF(N18:N320,"<>0").....Works for me
This comment was minimized by the moderator on the site
how to change color of the cell automatically, according to profit and loss
This comment was minimized by the moderator on the site
How can I add only the numbers that will give me 0? Thank you
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