✔ 最佳答案
在輸入A31:
=IF(SUM(A1:A30)>30000,"不能入數 - sum is greater than 30000",SUM(A1:A30))
2015-02-19 03:30:02 補充:
唔明你所謂的'剔除( )計算全部總和',如以下的例子,那一個是你要的結果?
i) 3+(2)+4=7....剔除(2),只考慮3+4=7
ii) 3+(2)+4=12....剔除(),把(2)當正數處理,3+2+7=12
2015-02-19 04:06:07 補充:
至於'不能入數字眼同時會變紅色',加入之前的formula後,你可利用'Conditional formatting',做法如下:
1. select A31
2. go to menu bar, click 'Home'->'Conditional Formatting'->'New Rule'
2015-02-19 04:06:44 補充:
3. In 'New Formatting Rule' window,
- Select 'Format only cells that contain'
- Edit the Rule Description:
...Format only cells with: 'Specific Text', 'containing' '不能入數',
...Click 'Format', select 'Font' tag, in 'Color' -> select red color
4. click 'ok' to close all windows.
2015-02-20 05:35:24 補充:
如你要的是例子(ii)
我已在你的另一個發問題(qid=7015021800038,發問時間:2015-02-18 14:20:52)作答。你可用abs() function 去剔除負值。
至於例(i),你可用"=if(C1<0,"",C1)"代替abs().