问题
Note- This Image is for representation. Column 'D', 'E' has around 100 rows

Here i want to put a Formula in 'G' column field where 7100 appears.
At the moment i am myself calculating 1100 + 1000 + 5000 and adding and writing 7100 in the G column. I want a Formula where Numbers in column 'E' are only added if column 'D' has something written in front of it for e.g: - 10 or 11, or 12, 555 , 666 & so on...... If nothing is written in column 'D' like for e.g:- next to 4000 then this 4000 should not be added to 7100 and likewise the last 'E' field 1000 also will not be added as nothing in written in column 'D' against it.
Requesting for help in coming up with such a formula.
回答1:
stick this in any cell in column G
=SUMIF(D:D,">0",E:E)
Note: this will only work if column D:D has numerical values
回答2:
You can use an array formula to do a similar thing to @mehow is suggesting, except that is will work with anything in the cell.
Use the following formula (remember to enter it by holding CTRL+SHIFT when you press RETURN or it wont work)
=SUM(IF(NOT(ISBLANK(D:D)),E:E,0))
If it is entered correctly as an array formula you will see {} around the formula
回答3:
=SUM(E:E) - SUMIF(D:D, "",E:E )
should do the trick !
来源:https://stackoverflow.com/questions/19951678/how-to-build-this-complex-if-formula